更多"有以下程序: #include <iostream> #inclu"的相关试题:
[单项选择]有以下程序: #include <iostream> #include <string> using namespace std; int main ( ) { char s[]="/n123//"; cout<<strlen (s) <<", "<<sizeof (s) <<end1; return 0; }
A. 赋初值的字符串有错
B. 6,7
C. 5,6
D. 6,6
[单项选择]有以下程序 #include<string.h> #include<iostream.h> void main( ) { char*p="abcde/0fghjik/0"; cout<<strlen(p);} 程序运行后的输出结果是
A. 12
B. 15
C. 6
D. 5
[单项选择]有以下程序 #include<string.h> #include<iostream.h> void main( ) { char*p="abcde/ofghjik/O"; cout<<strlen(p);} 程序运行后的输出结果是
A. 12
B. 15
C. 6
D. 5
[单项选择]下面程序的输出结果是 #include<iostream.h> #include<string.h> void main( ) { char p1[10],P2[10]; strcpy(p1,"abc"); strcpy(p2,"ABC"); char str[50]="xyz"; strcpy(str+2,strcat(P1,p2)); cout<<six; }
A. xyzabcABC
B. zabcABC
C. xyabcABC
D. yzabcABC
[单项选择]有以下程序: #include<iostream.h> #include<iomanip.h> void main( ) { cout.fill('*'); cout.width(10); cout,<setiosflags(ios::left)<<123.45<<endl; } 程序执行后的输出结果是( )
A. ****123.45
B. **123.45**
C. 123.45****
D. ***123.45*
[单项选择]有以下程序:#include <iostream.h>#include void main( ){ double d=
123.456789; cout<<setprecision(3)<<d<<",";
cout<<setprecision(4)<<d<<","; cout<<setprecision(5
)<<d<<end1;}程序执行后的输出结果是( )。
A. 123,123.4,123.45
B. 123,123.5,123.46
C. 123,123,123.4
D. 123.456789,123.456789,123.456789
[单项选择]有以下程序: #include<iostream> using namespace std; int main ( ) { int a[]={1,2,3, 4,5, 6, 7,8,9, 10, 11, 12}; int *p=a+5, *q=0; *q=* (p+5); cout<<*p<<" "<<*q<<end1; return 0; }
A. 运行后报错
B. 66
C. 6 12
D. 5 5
[单项选择]以下程序的执行结果是( )。 #include<iostream.h> #include<iomanip.h> void fun(int n) { if(n!=0) { fun(n-1); for(int i=1; i<=n; i++) cout<<setw(3)<<i; cout<<end1; } } void main( ) { fun(3); }
A. 0 0 1 0 1 2
B. 1 1 2 1 2 3
C. 1 2 2 3 3 3
D. 1 2 3