有如下程序段: 当输入为happy!时,输出的结果是( )。char str[14]={"I am "};strcat(str, "sad !");cin>>str;cout<
A. I am sad!
B. happy!
C. I am happy!
D. happy!ad!
查看答案
下面程序段的运行结果是( )。 char c[]="\t\v\\\0will\n";cout<
A. 3
B. 9
C. 14
D. 不确定
下面程序的运行结果是( )。 #include using namespace std;int main(){ int a[]={2, 3, 5, 4}, i; for(i=0; i<4; i++) switch(i%2){ case 0: switch(a[i]%2) { case 0: a[i]++; break; case 1: a[i]--;} break; case 1: a[i]=0; }for(i=0;i<4;i++) cout<
A. 3 3 4 4
B. 2 0 5 0
C. 3 0 4 0
D. 0 3 0 4
以下程序段的功能是( )。int a[]={4,0,2,3,1}, i, j, t;for(i=1; i<5; i++){ t=a[i]; j=i-1; while(j>=0&&t>a[j]){ a[j+1]=a[j]; j--; } a[j+1]=t;}
A. 对数组a进行插入排序(升序)
B. 对数组a进行插入排序(降序)
C. 对数组a进行选择排序(升序)
D. 对数组a进行选择排序(降序)
下面程序的输出结果为( )。#include using namespace std;int main( ){ int a[3],i,j,k=2; for(i=0;i<3;i++) a[i]=0; for(i=0;i
A. 0
B. 1
C. 2
D. 3