http://acm.hdu.edu.cn/showproblem.php?pid=1001
# include <stdio.h> int main () { int n; while(scanf("%d",&n) != EOF) { int Sum = 0; for(int i = 1; i <= n; i++) Sum += i; printf("%d\n\n",Sum); } return 0; }
时间: 2024-10-26 23:25:48
http://acm.hdu.edu.cn/showproblem.php?pid=1001
# include <stdio.h> int main () { int n; while(scanf("%d",&n) != EOF) { int Sum = 0; for(int i = 1; i <= n; i++) Sum += i; printf("%d\n\n",Sum); } return 0; }