c语言题目分析
#include<stdio.h>#include<stdlib.h>intmain(void){inti,j,m;intsum1=1,sum2=0;printf("In...
#include<stdio.h>
#include<stdlib.h>
int main(void)
{ int i,j,m;
int sum1=1,sum2=0;
printf("Input m:\n");
scanf("%d",&m);
for(i=1;i<=m;i++)
{
for(j=1;j<=i;j++)
sum1=sum1*j;
sum2=sum2+sum1;
}
printf("zhege=%d\n",sum2);
system("PAUSE");
return 0;
#include<stdio.h>
#include<stdlib.h>
int main(void)
{ int i,j,m;
int sum1,sum2=0;
printf("Input m:\n");
scanf("%d",&m);
for(i=1;i<=m;i++)
{ sum1=1;
for(j=1;j<=i;j++)
sum1=sum1*j;
sum2=sum2+sum1;
}
printf("zhege=%d\n",sum2);
system("PAUSE");
return 0;这两者效果不同在哪里?为什么? 展开
#include<stdlib.h>
int main(void)
{ int i,j,m;
int sum1=1,sum2=0;
printf("Input m:\n");
scanf("%d",&m);
for(i=1;i<=m;i++)
{
for(j=1;j<=i;j++)
sum1=sum1*j;
sum2=sum2+sum1;
}
printf("zhege=%d\n",sum2);
system("PAUSE");
return 0;
#include<stdio.h>
#include<stdlib.h>
int main(void)
{ int i,j,m;
int sum1,sum2=0;
printf("Input m:\n");
scanf("%d",&m);
for(i=1;i<=m;i++)
{ sum1=1;
for(j=1;j<=i;j++)
sum1=sum1*j;
sum2=sum2+sum1;
}
printf("zhege=%d\n",sum2);
system("PAUSE");
return 0;这两者效果不同在哪里?为什么? 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询