以下程序运行结果为#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
A: gae
B: ga
C: Language
D: programe
举一反三
- 以下程序的运行结果是#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));}
- 以下程序的输出结果是_______________ 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
- 以下程序的运行结果是( )。#include[stdio.h] int main() { int k=1, j=2, *p, *q, *t; p = &k; q = &j; t = p; p = q; q = t; printf("%d %d", *p, *q); } A: 2 1 B: 2 2 C: 1 1 D: 1 2
- 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); } 程序运行结果是:______