|
|
back to boardDiscussion of Problem 1068. Sumв чем может быть проблема? wrong answer Posted by remark 5 Jun 2013 12:23 using System; using System.Globalization; namespace a_b { public class Program { private static void Main() { int first = 0; int N = int.Parse(Console.ReadLine()); if (N <= System.Math.Abs(1000)) { if (N == 1) { first = 1; for (int i = 1; i <= N; i++) { first += i; } } if (N > 1) { first = 0; for (int i = 0; i <= N; i++) { first += i; } } if (N < 1) { first = 1; for (int i = 0; i >= N; i--) first += i; } Console.WriteLine(first); } } } } |
|
|