首页
外语
计算机
考研
公务员
职业资格
财经
工程
司法
医学
专升本
自考
实用职业技能
登录
计算机
有如下程序 #include #include using namespace std; int main(){ cout
有如下程序 #include #include using namespace std; int main(){ cout
admin
2020-11-11
21
问题
有如下程序
#include
#include
using namespace std;
int main(){
cout<
cout<<12.345<<__________<<34.567;
return 0;
}
若程序的输出是:
**12.345**34.567
则程序中下划线处遗漏的操作符是( )。
选项
A、setprecision(3)
B、fxed
C、setfill(’*’)
D、setw(8)
答案
D
解析
此题考查的是输出函数的格式控制。此题中,操作符setprecision的作用是设置浮点数的精度;fixed的作用是让浮点数按定点格式输出;setfill的作用是设置填充字符;setw的作用是设置输入输出的宽度,一次有效的设置。下划线处应填一个让34.567的输出宽度为8的操作符,即setw(8)。
转载请注明原文地址:https://kaotiyun.com/show/T0yp777K
本试题收录于:
二级C题库NCRE全国计算机二级分类
0
二级C
NCRE全国计算机二级
相关试题推荐
若类A和类B的定义如下:#includeclassA{inti,j;public:intgeti(){returni;}};classB:publicA
()使一个函数可以定义成对许多不同数据类型完成同一个任务。
使用VC6打开考生文件夹下的源程序文件modi2.cpp。阅读下列函数说明和代码,完成空出部分程序。函数fun(intn)的功能是实现对一个整数的加密,具体的加密方法是:一个四位长的整数,每位数字加上3然后除以9的余数代替该数字,再将第一位和第四位交换,
使用VC6打开考生文件夹下的源程序文件modi3.cpp。其中定义的类并不完整,按要求完成下列操作,将类的定义补充完整。完成以下功能:(1)利用define定义常量TRUE为1,定义常量FALSE为0,请在注释//********1*******
使用VC6打开考生文件夹下的源程序文件modi3.cpp。其中定义的类并不完整,按要求完成下列操作,将类的定义补充完整。(1)在类TestClass中定义name为字符串类型,age为整型,请在注释//********1********后添加语句
C++中的模板包括()。
随机试题
患者平日喜食油煎、辛辣和肥甘厚味之物,近日,口渴多饮伴有口臭、便秘、眩晕等症状,根据描述回答问题。久食油煎、辛辣之物会损伤()。
考生文件夹下存在一个数据库文件“samp2.mdb”,里面已经设计好“tEmp”和“tGrp”两个关联表对象及表对象“tBmp”和“tTmp”。试按以下要求完成设计:(1)以表对象“tEmp”为数据源,创建一个查询,查找并显示年龄大于等于40的职工的“编
喜剧具有的外在形式特征是()
与债务人有利害关系的第三人替代债务人履行债务的,若债务人提出异议,债权人______。
患者。女,27岁。产后第3周出现恶寒发热,右乳肿胀疼痛,体温38.7℃,体检见乳房肿大,皮色微红,无波动感。治宜
关于我国人民法院对民事案件的审理,下列说法错误的是()。
M2中不包括下面各项中的()。
危机管理策划是指为防止爆发危机或者危机发生后为减少消除危机带来的风险与损失,通过策划手段使人更有效地掌握事物和社会舆论及一些办法与措施的综合过程。根据上述定义,下列不属于危机管理策划的一项是()
云团_________地移动着,被吞没了多时的满月一下子跳出来,像一个刚出炼炉的银盘,辉煌灿烂,银光耀眼,把整个大地照得________的,荷叶上的青蛙,草丛里的蚂蚱和树枝上的小鸟,都被这突然_________的光明惊醒,欢呼、跳跃,高声鸣唱起来。填入划横
皮亚杰认为,思维起源于动作,而动作的本质是主体对客体的()
最新回复
(
0
)