Advertisement
VelizarAvramov

03. Exact Sum of Real Numbers

Nov 14th, 2019
215
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.46 KB | None | 0 0
  1. using System;
  2.  
  3. namespace _03._Exact_Sum_of_Real_Numbers
  4. {
  5.     class Program
  6.     {
  7.         static void Main(string[] args)
  8.         {
  9.             int n = int.Parse(Console.ReadLine());
  10.  
  11.             decimal sum = 0;
  12.  
  13.             for (int i = 0; i < n; i++)
  14.             {
  15.                 decimal currentNumbers = decimal.Parse(Console.ReadLine());
  16.                 sum += currentNumbers;
  17.             }
  18.             Console.WriteLine($"{sum}");
  19.         }
  20.     }
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement