下面程序运行输出的结果是【 】。
include <iostream>
using namespace std;
int main(){
char a[]="Chinese";
a[3]='\0';
cout<<a<<endl;
return 0;
}
第1题:
下面程序的运行结果是( )。
include<stdio.h>
main()
{int a=25;
fun(&A);
}
fun(int *x)
{ printf("%d\n",++*x);
}
第2题:
以下程序的输出结果是( )。 #include<iostream> #include<stdlib> using namespace std; void func(char **m) { ++m; cout<<*m<<endl; } main() { static char *a[]={"MORNING","AFTERNOON","EVENING"); char **n; n=a; func(n); system("PAUSE"); return 0; }
A.为空
B.MORNING
C.AFTERNOON
D.EVENING
第3题:
下面程序输出的结果是( )。 #include<iostream> using namespace std; int fuc (char *x); int main(){ cout<<fuc("hello")<<endl; return 0; } int fuc(char *x){ char *y=x; while(*y! ='\0')y++; return(y-x); }
A.5
B.6
C.0
D.语法错误,不能输出结果
第4题:
下面程序的输出结果是_______。 #include<stdio.h> main() { char*p[]={"DOOL","OPK","H","SP"}; int i; for (i=3;i>=0;i-,i-) printf("%c",*p[i]); printf("\n"); }
A.SO
B.SP
C.SPOPK
D.SHOB
第5题:
下面程序的运行结果是 ( ) # include<stdio.h> # include<string.h> main( ) { char * a="AbcdEf",* b="aBcD" a + +;b + +; printf("%d\n",strcmp(a,b)); }
A.0
B.负数
C.正数
D.无确定值