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

What here not so?
Posted by Kseniya 5 Jul 2013 20:16
#include <iostream>
#include <math.h>
using namespace std;

int main(int argc, char* argv[])
{
int N,Sum=0;
cout<<"Введите значение"<<endl;
cin>>N;
if(N>0 && N<=abs(1000))
{
 for(int i=0;i<=N;i++)
 {
    Sum+=i;
 }
 cout<<Sum;
}
if(N<0 && N<=abs(-1000))
{
  for(int j=0;j>=N;j--)
 {
    Sum+=j;
 }
cout<<Sum;
}    getch();
        return 0;
}

Edited by author 05.07.2013 20:36

Edited by author 05.07.2013 20:38
Re: What here not so?
Posted by Martynas 30 Jan 2014 19:48
from the first glance: it's supposed to be 10000, not 1000