ENG  RUSTimus Online Judge
Online Judge
Problems
Authors
Online contests
About Online Judge
Frequently asked questions
Site news
Webboard
Links
Problem set
Submit solution
Judge status
Guide
Register
Update your info
Authors ranklist
Current contest
Scheduled contests
Past contests
Rules
back to board

Discussion of Problem 1068. Sum

1068
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
Posted by MadPsyentist/Sam 16 Apr 2003 20:54
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)