标签:style blog color io for strong sp div on
题意
给出一个数n,求1+2+??+n=?
分析
注意多case
Accepted Code
1 /* 2 PROBLEM:hdu1001 3 AUTHER:NicoleLam 4 MEMO:水题 5 */ 6 7 #include<cstdio> 8 9 int main() 10 { 11 int n; 12 while (scanf("%d",&n)!=EOF) 13 { 14 int s=0; 15 for (int i=1;i<=n;i++) s+=i; 16 printf("%d\n\n",s); 17 } 18 return 0; 19 }
标签:style blog color io for strong sp div on
原文地址:http://www.cnblogs.com/NicoleLam/p/4018260.html