Sum Problem
Sample code :
#includeint main(){ int i,n; int sum; while(scanf("%d",&n)!=EOF) { sum=0; for(i=0;i<=n;i++) sum+=i; printf("%d\n\n",sum); } return 0;}
本文共 219 字,大约阅读时间需要 1 分钟。
Sum Problem
Sample code :
#includeint main(){ int i,n; int sum; while(scanf("%d",&n)!=EOF) { sum=0; for(i=0;i<=n;i++) sum+=i; printf("%d\n\n",sum); } return 0;}
转载地址:http://nihgx.baihongyu.com/