单项选择题
有如下程序: #include<iomanip> #include<iostream> using namespace std; int main(){ cout<<setfill('*')<<setw(6)<<123<<456; return 0; } 运行时的输出结果是( )。
A.***123***456
B.***123456***
C.***123456
D.123456
点击查看答案&解析
<上一题
目录
下一题>
热门
试题
单项选择题
若为Fraction类重载前增1运算符++,应在类体中将其声明为( )。
A.Fraction& operator++();
B.Fraction& operator++(int);
C.friend Fraction& operator++();
D.friend Fraction& operator++(int);
点击查看答案&解析
单项选择题
有如下程序:class Base{public:int data;};class Derived1:public Base{};class Derived2:protected Base{};int main(){Derived1 d1;Derived2 d2;d1. data=0; ①d2. data=0; ②return 0;}下列关于程序编译结果的描述中,正确的是( )。
A.①②皆无编译错误
B.①有编译错误,②无编译错误
C.①无编译错误,②有编译错误
D.①②皆有编译错误
点击查看答案&解析
相关试题
有如下程序:#include<iostream>using ...
有如下程序:#include<iostream>using ...
有如下程序:#include<iostream>using ...