Advertisement
Guest User

Exact sum of real numbers

a guest
Aug 21st, 2019
152
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.50 KB | None | 0 0
  1. using System;
  2. using System.Numerics;
  3.  
  4. namespace Exact_real_number_sum
  5. {
  6.     class Program
  7.     {
  8.         static void Main(BigInteger[] numero)
  9.         {
  10.             BigInteger number = BigInteger.Parse(Console.ReadLine());
  11.             BigInteger actual = 0;
  12.  
  13.             for (int i = 0; i < number; i++)
  14.             {
  15.                 BigInteger n = BigInteger.Parse(Console.ReadLine());
  16.                 actual += n;
  17.             }
  18.  
  19.             Console.WriteLine(actual);
  20.         }
  21.     }
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement