|
|
back to boardDiscussion of Problem 1068. Sumwhat's wrong with my code c???????????????????????? #include<stdio.h> int main() { long long i,n; while(scanf("%lld",&n)==1) { long long s=0; if(n==1) printf("%lld",n); if(n>1&&n<=10000) { for(i=1;i<=n;i++) { s=s+i; } } if(n<1&&n>=-10000) { for(i=1;i>=n;i--) { s=s+i; } } printf("%lld\n",s); } return 0; } |
|
|