Advertisement
SamuilPetrow

Console Input/Output - Task 9

Mar 14th, 2014
1,971
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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.             decimal sum = 0.00m;
  11.             decimal number = decimal.MinValue;
  12.             for (int i = 0; i < n; i++)
  13.             {
  14.                 number = decimal.Parse(Console.ReadLine());
  15.                 sum += number;
  16.             }
  17.             Console.WriteLine(sum);
  18.         }
  19.     }
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement