Sybatron

ExactSumOfRealNumbers Tech4.0

Jan 28th, 2019
142
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 ExactSumOfRealNumbers
  4. {
  5.     class Program
  6.     {
  7.         static void Main(string[] args)
  8.         {
  9.             int count = int.Parse(Console.ReadLine());
  10.  
  11.             decimal sum = 0;
  12.             for (int i = 0; i < count; i++)
  13.             {
  14.                 decimal number = decimal.Parse(Console.ReadLine());
  15.                 sum += number;
  16.             }
  17.             Console.WriteLine(decimal.Parse(sum.ToString()));
  18.         }
  19.     }
  20. }
Advertisement
Add Comment
Please, Sign In to add comment