HDU-1001 Sum Problem 添加链接描述 #include<stdio.h> int main (void) { int a,s,i; while(scanf("%d",&a)==1){ s=0; for(i=1;i<=a;i++) s+=i; printf("%d\n\n",s); } return 0;