未分类题

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

A.fill('*')
B.width(6);
C.fill('#')
D.###123
B.123###
C.***123

【参考答案】

A
解析:cout函数的fill()方法用来填充不足宽度:width()用来指定输出宽度。
热门 试题

单项选择题
A.B.C.D.