有如下程序:
#include
#include
using namespace std;
int main()
{
cout.fill('*');
cout<
return 0;
}
执行这个程序的输出结果是
A . 123*OK
B . 123*OK**
C . *123OK
D . *123**OK
第1题:
有如下程序: #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***
第2题:
如下程序的输出结果是 #include<iostream> void fun(int & X,inty){intt=x;x=y;y=t;} int main( ){ int a[2]={23,42}; fun(a[1],a[0]); std::cout<<a[0]<<","<<a[1]<<std::endl; return 0; }
A.42,42
B.23,23
C.23,42
D.42,23
第3题:
有如下程序:#include <iostream>#include<iomanip>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***
第4题:
有如下程序: #include <iostream> void fun(int& x, int y){int t=x;x=y;y=t;} int main () { int a[2]={23,42}; fun(a[1],a[0]); std::cout<<a[0]<<","<<a[1]<<std::endl; return 0; } 执行后的输出结果是
A.42,42
B.23,23
C.23,42
D.42,23
第5题:
有如下程序: #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***
第6题:
以下类模板成员函数定义正确的是:
A.template<class T> auto MyClass::foo(){ std::cout << "Aloha World!"<<std::endl; }#B.template<class T> auto MyClass<T>::foo(T t){ std::cout << t << std::endl; }#C.void MyClass<T>::foo(T t){ std::cout << t << std::endl; }#D.template<class T, int S> S MyClass<T, S>::foo(T t, S s){ s = static_cast<S>(t); std::cout << s << std::endl; retu