问题
单项选择题
有如下4个语句:①count<<’’A’’<<setfill(’’x’’)<<left<<setw(7)<<’’B’’<<endl;②count<<setfill(’’x’’)<<left<<setw(7)<<’’A’’<<’’B’’<<endl;③count<<’’A’’<<setfill(’’*’’)<<right<<setw(7)<<’’B’’<<endl;④count<<setfill(’’x’’)<<right<<setw(7)<<’’A’’<<’’B’’<<endl; 其中能显示A * * * * * * B的是
A.①和③
B.①和④
C.②和③
D.②和④
答案
参考答案:C
解析:setfill设置填充字符为*;默认输出有效位是6;setw(n)设置域宽,cout<<字符<< endl。