这两个程序有什么不同呢
int i,n,sum;i=0;n=0;sum=0;
printf("please input n:\n");
scanf("%d",&n);
for (i=1;i<=n;i+=2)
sum=sum+i;
printf("%d",sum);
int i,n,sum;
i=0;n=0;sum=0;
printf("please input n:\n");
scanf("%d",&n);
while (2*i+1<=n)
{
i++;
sum=sum+(2*i+1);
}
printf("%d",sum);