首页
外语
计算机
考研
公务员
职业资格
财经
工程
司法
医学
专升本
自考
实用职业技能
登录
计算机
有如下程序: #include<iostream> #include<iomanip> using namespace std; int main(){ cout<<setw(10)<<setfill(’x’)<<s
有如下程序: #include<iostream> #include<iomanip> using namespace std; int main(){ cout<<setw(10)<<setfill(’x’)<<s
admin
2017-11-28
84
问题
有如下程序:
#include<iostream>
#include<iomanip>
using namespace std;
int main(){
cout<<setw(10)<<setfill(’x’)<<setprecision(8)<<left;
cout<<12.3456793<<______<<98765;
return 0;
}
若程序的输出是12.345679x98765xxxxx,则划线处缺失的部分是( )。
选项
A、setw(10)
B、setfill(’x’)
C、setprecision(8)
D、right
答案
A
解析
根据程序输出的结果最后5个位置用x进行填充,又因为setw(10)设置输出的宽度效果只对一次输出有效。所以划线处应该填写setw(10)。
转载请注明原文地址:https://kaotiyun.com/show/z3Ap777K
本试题收录于:
二级C题库NCRE全国计算机二级分类
0
二级C
NCRE全国计算机二级
相关试题推荐
排序是计算机程序设计中的一种重要操作,常见的排序方法有交换排序、选择排序和【 】等。
有以下程序#include<iostream>#include<string>usingnamespacestd;classbase{private:charbaseName[10];
有如下程序:#include<iostream.h>#include<iomanip.h>usingnamespacestd;classCSum{intx,y;public:
若类A和类B的定义如下:classA{inti,j;public:intgeti(){returni;}};classB:public
以下程序的输出结果______。#include<iostream.h>voidmain(){inta=0;a+=(a=8);cout<<a;}
下列程序运行后的输出结果是______。#include<iostream.h>voidmain(){ints=0,kfor(k=7;k>=0;k--){switch(k){cas
随机试题
行政法律责任必须由有关()依照行政法律规范,包括实行规范和程序规范所规定的条件和程序予以追究。
原发性肝癌最常见的组织学类型为
A、吸收散射线B、吸收漏射线C、减少照射野D、抑制散射线E、吸收原发低能射线滤线栅的作用是
单位保证金存款按照保证金担保对象的不同,可以分为()。
A注册会计师拟实施穿行测试,不属于注册会计师执行穿行测试目的是()。
在上次考试中,老师出了一道非常古怪的难题,有86%的考生不及格。这次考试之前,王见明预测说:“根据上次考试情况,这次考试老师不一定会出那种难题了。”胡思明说:“这就是说这次考试老师肯定不出,那种难题了。太好了!”王见明说:“我不是这个意思。”下面哪
对于假想防卫,应当()。
下列数据结构中,能用二分法进行查找的是
ATheSpeechofthePresiderThepresidingovermeetingsisoneofthecommunicativeactivitiesatinternationalacademicconfer
A、TheychallengedSerenaWilliams’sethnicity.B、TheyfollowedtherolemodelofSerenaWilliams.C、Theyraisedanumberofcomp
最新回复
(
0
)