有以下程序 #include <sthio.h> Main() {int s=0,n; For (n=0;n<3;n<0++) {switch(s) { case 0; Case 1;s+=1; Case 2;s+=2;break; Case 3;s+3; Case 4;s+=3 ; } printf((“%dn”,s); } } 程序运行后的结果是 A 1,2,4 。 B 1,3,6 。 C 3,10,14 。 D 3,6,10。
有以下程序 #include <stdio.h>#include <stdlib.h>fun(int *p1,int *p2,int *s){ s=(int*)malloc(sizeof(int));*s=*p1+*p2;free(s);}void main(){ int a=1,b=40,*q=&a;fun(&a,&b,q);printf("%d",*q);}程序运行后的输出结果是 42。 0。 1。 41。
有以下程序 #include <stdio.h>main(){ char a[5][10]={"one","two","three","four","five"};int i,j;char t;for(i=0;i<4;i++)for(j=i+1;j<5;j++)if(a[i][0]>a[j][0]) { t=a[i][0];a[i][0]=a[j][0];a[j][0]=t;} puts(a[1]);}程序运行后的输出结果是 fwo。 fix。 two。 owo。
若函数中有定义语句:int a;,则( )。