单项选择题
有如下程序:
#include<iostream>
#include<iomanip>
using namespace std;
int main( )
cout<<setprecision(3)<<fixed<
cout<<12.345<<______<<34.567;
return 0;
若程序的输出是:
**12.345**34.567
则程序中下画线处遗漏的操作符是
A.setprecision(3)
B.fixed
C.setfill(’*’)
D.stew(8)
点击查看答案&解析
<上一题
目录
下一题>
热门
试题
多项选择题
有如下程序: #include<iostream> using namespace std; class Obj static int i; public: Obj( )i++ ~Obj( )i--; static int getVal( )return i; ; int Obj::i=0; void f( )Obj ob2;cout<<ob2.getVal( ); int main( ) Obj obl; f( ); Obj*ob3=new Obj;cout<<ob3->getVal( ); delete ob3;cout<<Obj::getVal( ); return 0; 程序的输出结果是
A.232
B.231
C.222
D.221
点击查看答案&解析
单项选择题
有如下程序: #include<iostream> using namespace std; class Base private: void funl( )constcout<< funl ; protected: void fun2( )consttout<< fun2 ; public: void fun3( )consteout<< fun3 ; ; class Derived:protected Base public: void fun4( )constcout<< fun4 ; ; int main( ) Derived obj; obj.funl( ); ① obj.fun2( ); ② obj.fun3( ); ③ obj.fun4( ); ④ return 0; 其中有语法错误的语句是
A.①②③④
B.①②③
C.②③④
D.①④
点击查看答案&解析
相关试题
有如下程序: #include<iostream> usi...