有如下程序: #include #include using namespace std; int main(){ cout

admin2020-07-30  21

问题 有如下程序:
    #include
    #include
    using namespace std;
    int main(){  
    cout<    cout<<12.3456793<<__________<<98765;
    return 0;
    }
若程序的输出是12.345679x98765xxxxx,则划线处缺失的部分是(    )。

选项 A、setw(10)
B、setfill(ˊxˊ)
C、setprecision(8)
D、fight

答案A

解析 根据程序输出的结果最后5个位置用x进行填充,又因为setw(10)设置输出的宽度效果只对一次输出有效。所以划线处应该填写setw(10)。
转载请注明原文地址:https://kaotiyun.com/show/gDyp777K
0

最新回复(0)