首页
外语
计算机
考研
公务员
职业资格
财经
工程
司法
医学
专升本
自考
实用职业技能
登录
计算机
有如下程序: #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
51
问题
有如下程序:
#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>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.骨骼C.肾脏D.肝脏E.皮肤合成1,25-(OH)2-D3的器官是
左心衰竭发生呼吸困难的主要机制是
在下列有关可转让信用证的说明中,错误的说法是()。
网络犯罪指行为人运用计算机技术,借助网络对系统或信息进行攻击破坏,故意实施触犯有关法律规范的行为。下列不属于网络犯罪的是()。
Mr.Jones,Iamreallypleased______you.AndIhopewewillbeabletoseeeachotherinnotlongtime.
A—costpriceJ—guaranteedpriceB—factorypriceK—cashpriceC—netpriceL—marketpriceD—pricefreeonboardM—preferentialpri
WhenIsawJane,Istoppedandsmiled,butshe______meandwalkedon.
最新回复
(
0
)