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

Что не так? C#
Posted by IBets 20 Aug 2016 01:25
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Text;


namespace Пример
{

    class Programm
   {
         static void Main(string[] args)
        {
           int num= int.Parse( Console.ReadLine());

            int sum = 0;
            if (num<10000&&num>-10000)
            {


                if (num > 0)
                {
                    for (int i = 1; i <= num; i++)
                    {
                        sum += i;
                    }
                }
                else if (num < 0)
                {
                    for (int i = num; i <= 1; i++)
                    {
                        sum += i;
                    }
                }
            }

            Console.WriteLine(sum);
        }


    }

}