,6,15,20,12}; void main() { int i,s1,s2; s1=s2=0; for(i=0; i<6; i++) { switch(a[i]% 2){ case 0:s2 +=a[i];break; case 1: s1+=a[i];break; }} printf("%d %d\n",s1,s2); } 运行结果: 2042 24. #include<stdio.h> void main() { int a[3][3]={{3,5,7},{9,11,13},{6,8,20}}; int i,*p=&a[0][0]; for(i=0;i<9;i++) { if(*p>10) printf("%d ",*p); p++; } printf("\n"); } 运行结果: 11 13 20 25. #include<stdio.h> #include<string.h> struct Worker { char name[15]; int age; float pay; }; void main() { struct Worker x; char *t="liouting"; int d=38; float f=4 00; strcpy(x.name,t); x.age=d; x.pay=f; x.age++; x.pay*=2; printf("%s %d %6.2f\n",x.name,x.age,x.pay); } 运行结果: liouting 39 800.00 26. #include<stdio. h> void main() { int i,j ,k==0; for ({i=O;i<5;i++) for(j=i;j<5;j++) k++;; printf("%d\n",k) ;} 运行结果: 15 27. #include<stdio. h>