1+2+3+……100的和

#include<stdio.h>
main()
{
int i,s=0;
i=1;
while(i<=100)
{

s=s+i;
i=i+1;
}
printf("1+2+3...+100=%d\n",s);


}

猜你喜欢

转载自blog.csdn.net/qq_40374303/article/details/80043419