Advertisement
Spocoman

03. Exact Sum of Real Numbers

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