题目内容

下列程序的运行结果是( )。#include int main(){int i=1,n=3,j,k=3;int a[5]={1,4,8};while (i<=n && k>a[i])i++;for (j=n-1;j>=i;j--)a[j+1]=a[j];a[i]=k;for (i=0;i<=n;i++)printf("%3d",a[i]);printf("\n");return 0;}

查看答案
更多问题

下列程序的运行结果是_____。#include int main(){int s[4][4],i,j,k;for (i=0;i<4;i++)for (j=0;j<4;j++)s[i][j]=i-j;for (i=0;i<3;i++)for (j=i+1;j<4;j++){k=s[i][j];s[i][j]=s[j][i];s[j][i]=k;}for (i=0;i<4;i++){printf("\n");for (j=0;j<4;j++)printf("%4d",s[i][j]);}return 0;}

下列程序的运行结果是______。#includeintmain(){inti=5;charc[6]="abcd";do{c[i]=c[i-1];}while(--i>0);puts(c);return0;}

下面程序的运行结果是( )。#includeint main(){int k=4,m=1,p;int func(int a,int b);p=func(k,m);printf("%d ",p);p=func(k,m);printf("%d\n",p);return 0;}int func(int a,int b){static int m=0,i=2;i+=m+1;m=i+a+b;return(m);}

下面程序的运行结果是______。#includeint main(){int i=5;int sub(int n);printf("%d\n",sub(i));return 0;}int sub(int n){int a;if(n==1) return 1;a=n+sub(n-1);return(a);}

答案查题题库