![](https://static.youtibao.com/asksite/comm/h5/images/m_q_title.png)
main(){int s,i;for(s=0,i=1;i<3;i++,s+ =i)printf("%d\n",&s);}错误:______改正:______
main()
{int s,i;
for(s=0,i=1;i<3;i++,s+ =i)
printf("%d\n",&s);
}
错误:______
改正:______
参考答案:错误
![](https://static.youtibao.com/asksite/comm/h5/images/solist_ts.png)
main()
{int s,i;
for(s=0,i=1;i<3;i++,s+ =i)
printf("%d\n",&s);
}
错误:______
改正:______
参考答案:错误
#include"stdio.h"
main()
{int i,s;
s=0;
for(i=0;i<=10;i++;s=s+i)
printf("%d",s);
}
错误:______
改正:______
#include<stdio.h>
ss(char*s)
{char *p=s:
while(*p)p++;
return(p-s);}
main()
{char *a="abded";
int i;
i=ss(a);
printf("%d\n",i);}
程序运行结果是:______
struct stud
{char num[6];
int s[4];
double ave=0.0;
}a;
main()
{int i;
for(i=0;i<4;i++)scanf("%d",&a.s[i]);
for(i=0;i<4;i++)a.ave+ =a.s[i];
printf("%f",a.ave);
}
错误:______
改正:______
参考答案:错误
#include<stdio.h>
int f(int n)
{static int s=1;
while(n)s*=n--;
return s;
}
main()
{int i,j;
i=f(3);j=f(5);
printf("The output is:\n");
printf("i=%d j=%d\n",i,j);
}
A.25
B.15
C.20
D.24
下面程序的运行结果是【 】。 include<stdio.h> define SIZE 12 main() { char s[SIZE];int i;for(i=0;i<SIZE;i++) s[i]=A+i+321; sub(s,7,SIZE-1); for(i=0;i<SIZE;i++) printf("%c",s[i]); printf("\n");} sub(char *a,int t1,int t2) { char ch; while(t1<t1) { ch=*(a+t1); *(a+t1)=*(a+t2); *(a+t2)=ch; t1++;t2--;} }
下面程序的运行结果是【 】。 include<stdio.h> define SIZE 12 main() { char s[SIZE]; int I;for(I=0;I<SIZE;I++) s[I]=′A′+I+321; sub(s,7,SIZE-1); for(I=0;I<SIZE;I++) printf("%c",s[I]); printf("\n");} sub(char*a,int t1,int t2) { char ch; while (t1<t2) { ch=*(a+t1); *(a+t1)=*(a+t2); *(a+t2)=ch; t1++;t2--; } }
写出下列程序的运行结果。
#include void Fun(){int num=20;cout<< "The Fun's num is"<< num<< endl;
}void main(){int num=10;cout<< "The main's num is "<< num<< endl;Fun();{int num=30;
cout<< "The Field's num is "<< num<< endl;}cout<< "The main's num is "<< num<< endl;}
下列程序的输出结果是______。 include<stdio.h> sb(int s[],int B) {static int n=3; b=s[n]; n--; return(B) ; } main() { int s[]={1,5,6,8}; int i,x=0; for(i=0;i<4;i++) {x=sb(s,x); printf("%d",x); } printf("\n"); }
#include<stdio.h>
main()
{int a[10]={2,4,0,-5,10,6,-8,9,6,7};
inti,s=0,count=0;
for(i=0;i<10;i++)
if(a[i]>0){s+=a[i],count++;}
else continue;
printf("s=%d,count=%d\n",s,count);
}
程序运行结果是:______