有如下程序: #include<iostream> using namespace std; int main() { cout.fill(’*’); cout.width (6);

admin2009-01-15  23

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

选项 A、###123
B、123###
C、***123
D、123***

答案1

解析 根据定义,开始设置的coutfill.(‘*’),被后面的cout.fill(‘#’)替代,所以cout的输出结果是###123。
转载请注明原文地址:https://kaotiyun.com/show/yfkp777K
0

最新回复(0)