|
|
back to boardDiscussion of Problem 1068. Sum"Почему я ошибся " help me please !!! Posted by Daniel 4 Oct 2011 14:10 #include <iostream> int main() { int n,i; std::cin>>n; int sum=0; if(n<0) { for(i=n;i<=1;i++) sum+=i; std::cout<<sum;
} else {
for(i=n;i>=1;i--) sum+=i; std::cout<<sum; } return 0;} |
|
|