请阅读以下程序,该程序运行结果是()。#includeintmain(){inti,b,k=0;for(i=1;i<=5;i++){b=i%2;while(b-->=0)k++;}printf("k=%d b=%d",k,b);//%d b=之间有两个空格return0;}
查看答案
下列程序的运行结果是( )。#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);}