Advertisement
SamuilPetrow

Console Input/Output - Task 9

Mar 14th, 2014
158
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.47 KB | None | 0 0
  1. using System;
  2.  
  3. namespace ConsoleInputOutput
  4. {
  5.     public static class SumOfN
  6.     {
  7.         public static void Main()
  8.         {
  9.             long n = long.Parse(Console.ReadLine());
  10.             long sum = 0;
  11.             long number = long.MinValue;
  12.             for (int i = 0; i < n; i++)
  13.             {
  14.                 number = long.Parse(Console.ReadLine());
  15.                 sum += number;
  16.             }
  17.             Console.WriteLine(sum);
  18.         }
  19.     }
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement