举一反三
- #include [stdio.h] int main() { int a=1; int *pa; pa=&a; printf("a=%d\n",a); printf("*pa=%d\n",*pa); *pa=2; printf("a=%d\n",a); return 0; }的运行结果()
- #include [stdio.h]int main(){ char a, *pa; int c, *pc; pa = &a; pc = &c; *pa = sizeof(pa); *pc = sizeof(pc); printf("%d %d %d %d", a, c, sizeof(a), sizeof(c)); return 0;}
- 以下程序输出结果是___________.#include [stdio.h]#include [string.h]int main() { int a=2,*pa=&a; float n=5.888,b,*pn=&n; b=*pa+(int)*pn;printf("%.1f\n",b); return 0;}
- 以下程序输出结果是( ).#include [stdio.h]int main() { int a=2,*pa=&a; float n=5.888,b,*pn=&n; b=*pa+(int)*pn; printf("%.1f\n",b); return 0;} A: 8 B: 7 C: 8.0 D: 7.0
- 下列程序运行后的输出结果是:_____#includestdio.hvoid fun( int *pa, int pb ) { int pt; pt = *pa, *pa = pb, pb = pt;}int main( ){ int x=1, y=2; fun(x, y); printf(%d, x==y); return 0;}
内容
- 0
有以下程序段,输出结果为()。 #include<stdio.h> void swap(int *p1) {int b=20; p1=&b; } main() {int a=10,*pa; pa=&a; swap(pa); printf("%d,%d",a,*pa); }
- 1
下列程序的运行结果是?#include [stdio.h] int f(int n); int main() { printf("%d\n", f(f(f(f(1))))); return 0; } int f(int n) { return n + 1; } A: 5 B: 4 C: 3 D: 2
- 2
以下代码的输出是 :void swap( int *pa, int *pb ) { int pt; pt = *pa, *pa = *pb, *pb = *pa; } int main(void) { int x=1, y=2; swap(&x, &y); printf("%d%d", x, y); }
- 3
以下代码的输出是 :void f( int *pa, int *pb ) { int pt; pt = *pa, *pa = *pb, *pb = *pa; } int main(void) { int x=1, y=2; f(&x, &y); printf("%d%d", x, y); }
- 4
以下程序的输出结果是______。#include [stdio.h]int f(int a[ ],int n){ if(n>1)return a[0]+f(&a[1],n-1);else return a[0];}int main(){ int aa[3]={1,2,3},s;s=f(&aa[0],3);printf(“%d\n”,s);return 0; }