SHARE
TWEET

03. Exact Sum of Real Numbers

VelizarAvramov Nov 14th, 2019 82 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top