以下程序的运行结果是#include<stdio.h>void main(){static char a[]="Language",b[]="programe";char *p,*q;int k;p=a;q=b;for(k=0;k<=7;k++)if(*(p+k)==*(q+k))printf("%c",*(p+k));}
举一反三
- 以下程序运行结果为#include[stdio.h] void main() { char a[] = "Language", b[] = "programe"; char *p, *q; int k; p = a; q = b; for (k=0; k<8; k++) if (*(p+k) == *(q+k)) printf("%c", *(p+k)); } A: gae B: ga C: Language D: programe
- 以下程序的输出结果是_______________ void main( ) { int k;char a[ ]=”language”,b[ ]=”program”; char *p=a,*q=b; for(k=0;k<=5;k++) if(*(p+k)==*(q+k)) printf("%c",*(q+k)); }
- 下面程序的运行结果是____ #include [stdio.h] #include [string.h] main() { int a[3][3]={{2},{4},{6}}; int k,*q=&a[0][0]; for(k=0;k<2;k++) { if(k= =0) a[k][k+1]=*q+1; else ++q; printf(“%d”,*q); } A: 26 B: 23 C: 36 D: 33
- main() { int k,P; int s[]={1,-9,7,2,-10,3}; for(p=0,k=P;p<6;p++) if(s>s[k])k=p; printf("%d\n",k); } 程序运行结果是:______
- 以下程序输出的结果是____。 #include #include main( ) { char w[ ][10]={"ABCD","EFGH","IJKL","MNOP"}, k; for(k=1;k<3;k++) printf("%s ",&w[k][k]); }