程序代码:
(1) A、double fun(int x,int y); (2) B、12 (3) (x>y) ? z=x+y : z= x-y (4) auto int (5) <表达式1> ? <表达式2> : <表达式3> (6) a[0][0]=(10),a[1][1]= (12),a[2][2]= (1) (7) 2 (8) 668977 (23) 1996035432 (24) 6 8 (25) p=FFEE &x=FFEE *p=10 x=10 (26) #include <stdio.h> int main(void) { int i, j, k; for(i = 1; i<4 ; i++) { for(j=1 ; j<=4-i; j++) { k = i * j; printf("%d*%d=%d ", i, j, k); } printf("\n"); } return 0; } (27) 9 #include <stdio.h> int main(void) { char str[81]; char *p = str; int num; num = 0; gets(p); while(p[num]!='\0') { num++; } printf("The length of string is %d\n" , num); return 0; } (28) 5 7 10 14 15 20 21 25 28 30 35 40 42 45 49 50 55 56 60 63 65 70 75 77 80 84 85 90 91 95 98 100 (29) #include <stdio.h> void swap(int *x, int *y) { int t; t = *x; *x = *y; *y = t; } int main(void) { int a = 7, b = 8, *p = &a, *q = &b; printf("a = %d, b = %d\n", a, b); swap(p, q); printf("a = %d, b = %d\n", a, b); return 0; }
Only the Code Tells the Truth K.I.S.S