Advertisement
Guest User

Untitled

a guest
Jan 24th, 2017
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.56 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5.  
  6. namespace Exact_sum_of_real_numbers
  7. {
  8. class Program
  9. {
  10. static void Main(string[] args)
  11. {
  12.  
  13.  
  14.  
  15. // Console.WriteLine("The lower limit of numbers is 0. Enter upper limit:");
  16. var n = int.Parse(Console.ReadLine());
  17. decimal sum=0m;
  18. decimal[] array = new decimal[n];
  19. for(int i = 0; i < n; i++)
  20. {
  21. array[i]= decimal.Parse(Console.ReadLine());
  22. sum += array[i];
  23. }
  24.  
  25. Console.WriteLine("{0}",sum);
  26.  
  27.  
  28. }
  29. }
  30. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement