以下程序的输出结果为_________void f(int a,int *b){int t;t=a;a=*b;*b=t;}int main(){int x=2,y=3;f(x,&y);printf("%d%d\n",x,y);return 0;}
查看答案
#include void change(int *aa,int bb) { *aa=*aa*2+1; bb=bb+3;} int main(){ int a=6,b=5; change(&a,b); printf("%d %d\n",a,b); return 0;}以上程序的运行结果是( )
以下程序运行结果为( )#include int Max(int *a,int n){ int i,max = a[0]; for(i = 1;i < n;i++) {if(a[i] > max)max = a[i]; } return max;}int main(){ int x,a[5] = {4,3,2,1,0}; x = Max(a,5); printf("%d",x); return 0;}
下面程序的运行结果是_____________________#include int main(void){ int x[] = {1,2,3}; int s = 1, i, *p = x; for (i=0; i<3; i++) {s*= *(p + i); } printf("%d\n", s); return 0;}
以下程序的输出结果是( )#includeint main(){ int i,b[6]={1,2,3,4,5,6},*ptr=b; for(i=0;i<3;i++)b[i*2]*=2; for(i=0;i<6;i++)printf("%d ",ptr[i]);}