|
|
back to boardDiscussion of Problem 1068. Sum1068 Posted by Dimitar 16 Apr 2003 10:28 It keep saying WRONG ANSWER. Why? Here is the code that i have submitted. /////1068 #include <iostream> int main () { int a,suma; suma = 0; std::cin>>a; if (a<10000){ if (a > 0){for(int i=1; i<=a; i++){ suma = suma + i; }} else for (int k=1;a<=k;a++) suma = suma + a; std::cout<<suma; } return 0; } Re: 1068 The input consists of a single integer N that is not greater than 10000 by it's absolute value (abs(a)<=10000) not (a<10000) |
|
|