网友您好, 请在下方输入框内输入要搜索的题目:

题目内容 (请给出正确答案)
单选题
执行语句:cout<
A

123*******OK

B

123#######OK

C

123********OK********

D

123#######OK#######


参考答案

参考解析
解析:
cout.fill()用于设置或返回输出的填充字符,默认是空格, fill()函数的设置一直有效,直到下一个fill()函数改变该值为止。setw(int n)作用是设置输入输出的宽度,此设置只对一次输入或输出有效,在完成一次数据的输入或输出后,宽度设置自动恢复为0。注意:默认为输出数据在指定宽度内右对齐。
更多 “单选题执行语句:cout A 123*******OKB 123#######OKC 123********OK********D 123#######OK#######” 相关考题
考题 有如下程序:#include#includeusing namespace std;int main(){cout.fill('*');coutreturn 0;}执行这个程序的输出结果是A . 123*OKB . 123*OK**C . *123OKD . *123**OK

考题 执行语句序列 ofstream outfile(”DATA.DAT"); if(…)cout<<"OK";elsec out<<"FAIL"; 后,如果文件打开成功显示“OK”,否则就显示“FAIL”。由此可知,上面if语句的…处的表达式应是A.outfile.fail()或 outfileB.outfile.good()或 !outfileC.outfile.good()或 outfileD.outfile.fail()或 !outfile

考题 若语句: cout') 若语句: cout<<setfill('>')<<setw(5)<<3141512<<setw(5)<<"OK!"; 是程序中第一个输出语句,则输出结果是A.3141512>>OK!B.31415120K!>>C.414150K!>>D.31415>>OK!

考题 执行cout<<setw(5)<<123<<setfill(*)<<16;的输出为A.**12316B.123**16C.12316D.12316**

考题 ( 34 )假定下列语句都是程序运行后首次执行的输出语句,其中输出结果与另外三条语句不同的语句是A ) coutsetfill ( '*' ) 123setw ( 9 ) 321;B ) coutsetfill ( '*' ) setw ( 6 ) left123setw ( 6 ) right321;C ) cout123setfill ( '*' ) setw ( 6 ) 321;D ) coutsetfill ( '*' ) SetW ( 9 ) left123321;

考题 执行Print"A123"+123语句,系统会给出出错提示。()

考题 有如下程序:include include using namespace std;int main(){cout.fill(' 有如下程序:#include <iostream>#include <iomanip>using namespace std;int main(){cout.fill('*');cout<<left<<setw(4)<<123<< "OK"<<end1;return 0;}执行这个程序的输出结果是( )。A.123*OKB.123*OK**C.*123OKD.*123**OK

考题 要在屏幕上显示“Hello,world!”应执行语句cout <<【 】。

考题 执行语句:{cout<<setfill('*')<<setw(10)<<setfill('#')<<left<<123<<"OK"<<endl;return 0;)后将输出( )。A.123*******OKB.123#######OKC.123********OK********D.123#######OK########

考题 执行语句序列ofstream outfile(“DATE.DAT”);if(…)cout<<"OK"; else cout<<"FAIL"后,如果文件打开成功,显示“OK”,否则显示"FAIL"。由此可知,上面if语句…处的表达式是:A.outfile.fail( )或outfileB.outfile.good( )或outfileC.outfile.good( )或!outfileD.outfile.fail( )或!out file

考题 对于下面的程序: ifstream fin(c:\test.txt) ; if(fin) cout < < "ok"; else cout < < "wrong"; if语句中的内容可以换为A.fin. fail( ) ;B.fin. bad( ) ;C.fin. good( ) ;D.fin. eof( ) ;

考题 有如下程序: include using namespace std; int main() { cout.f 有如下程序: #include<iostream> using namespace std; int main() { cout.fill('*') cout.width(6); cout.fill('#') cout<<123<<endl; return 0; } 执行后的输出结果是A.###123B.123###C.***123D.123***

考题 若语句:cout') 若语句: cout<<seffill('>')<<setw(5)<<3141512<<sctw(5)<<"OK!"; 是程序中第1个输出语句,则输出结果是( )。A.3141512>>OK!B.31415120K!>>C.314150K!>>D.31415>>OK!

考题 若执行语句:cout<<setfill('*')<<setw(10)<<123<<'OK'<<end1后将输出A.*******123OKB.123********OKC.*******123********OKD.123*******OK********

考题 有如下程序:includeusing namespace std;int main(){ cout.fill('*'); cout.width (6 有如下程序: #include<iostream> using namespace std; int main() { cout.fill('*'); cout.width (6); cout.fill('#'); cout<<123<<end1; return 0; }执行后的输出结果是______ 。A.###123B.123###C.***123D.123***

考题 执行下列语句后,输出结果为cout.put('s');cout<<'c'<<'a';A.caB.seaC.sD.a

考题 对于下面的程序 ifstream fin(c:\test.txt); if(fin) cout<<"ok"; else cout<<"wrong"; 对于if语句中的内容可以换为A.fin.fail( ):B.fin.bad( );C.fin.good( );D.fin.eof( );

考题 若执行语句:cout<<setfill('*')<<setw(10)<<setfill('#')<<left<<123<<"OK"<<end1后将输出A.123*******OKB.123#######OKC.123********OK********D.123#######OK#######

考题 若执行语句:cout<<setfill('*')<<setw(10)<<123<<"OK"<<end1后将输出A.*******1230KB.123********OKC.*******123********OKD.123*******OK********

考题 执行语句: int result=100; cout= 60)(result 执行语句:int result=100;cout<<(((result>= 60)(result<=100))?"good":"general");结果是【 】。

考题 若执行语句:cout<<setfill('*')<<setw(10)<<123<<"OK"<<endl后将输出( )。A.******* 1230KB.123********OKC.*******123********OKD.123*******OK********

考题 有如下程序: include include using namespace std; int ma 有如下程序: #include <iostream> #include <iomanip> using namespace std; int main() { cout.fill('*'); cout << left << setw(4) << 123 << "OK" << endl; return 0; }A.123*OKB.123*OK**C.*123OKD.*123**OK

考题 执行语句:cout<<setfill('*')<<setw(10)<<setfill('#')<<left<<123<<"OK"<<endl;后将输出A.123*******OKB.123#######OKC.123********OK********D.123#######OK########

考题 执行语句:coutsetfill('*')setw(10)setrill('#')left123"OK"endl;后将输出( )。A.123*******0KB.123#######OKC.123********0K********D.123#######OK########

考题 有如下程序: include include using namespace std; int main() {cout.f 有如下程序: #include <iostream> #include <iomanip> using namespace std; int main() { cout.fill('*'); cout.width(6); cout.fill('#'); cout<<123<<end1; return 0; } 执行生的输出结果是( )。A. ###123B.123###C. ***123D.123***

考题 执行语句:cout<<setfill(*)<<setw(10)<<setrill()<<left<123<<"OK"<<endl;后将输出( )。A.123*******0KB.123OKC.123********0K********D.123OK

考题 执行下列语句序列后, ofstream outfile("DATA.DATA") if(…)cout<<"OK";else cout<<"FAIL";如果文件打开成功显示OK,否则就显示FAIL。由此可知,…处的表达式应是( )。A.outfile.fail()或outfileB.outfile.fail()或! outfileC.outfile.good()或outfileD.outfile.goodl()或! outfile