杭电上acm1001题,我哪错了??????

2024-12-17 09:09:35
推荐回答(1个)
回答1:

#include
void main()
{
int s=0,n,m=1;
while(scanf("%ld",&n)!=EOF)
{
s=0;//初始化
m=1;
do{
s+=m;
m++;
}while(m<=n);
printf("%ld\n\n",s);
}
}