首页
外语
计算机
考研
公务员
职业资格
财经
工程
司法
医学
专升本
自考
实用职业技能
登录
计算机
有如下程序: #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
82
问题
有如下程序:
#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://www.kaotiyun.com/show/z3Ap777K
本试题收录于:
二级C题库NCRE全国计算机二级分类
0
二级C
NCRE全国计算机二级
相关试题推荐
下列程序的输出结果是______。#include<iostream>usingnamespacestd;ClassTest{public:Test(){cnt++;}~Test(){cnt--;}
有以下程序#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(){ints=0,kfor(k=7;k>=0;k--){switch(k){cas
随机试题
民事义务依义务人行为的方式或者内容可划分为积极义务和消极义务,下列各项中,属于消极义务的有()。
下列选项中,属于外部招募特点的是()。
调查报告的主要特点是()
A.包扎疗法B.暴露疗法C.开放疗法D.湿敷疗法E.浸泡疗法易造成交叉感染的方法是
经营单位持主管海关签发的“开设银行保证金台账联系单”,向主管海关指定的()办理保证金台账设立手续。
要求发行人在发行债券过程中,不仅要公开披露有关信息,而且必须符合一系列实质性的条件的是()制度。
“春秋三传”不包括下列哪一项?()
Whatshouldonedoifhewantstoworkmoreefficientlyathislowpointinthemorning?
A、ItwasestablishedinGeorgeWashingtonUniversityin1937.B、ItwasestablishedintheNationalMuseumofAmericanHistoryin
Would-belanguageteacherseverywherehaveonethingincommon:theyallwantsomerecognitionoftheirprofessionalstatusand
最新回复
(
0
)