Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- namespace Exact_sum_of_real_numbers
- {
- class Program
- {
- static void Main(string[] args)
- {
- // Console.WriteLine("The lower limit of numbers is 0. Enter upper limit:");
- var n = int.Parse(Console.ReadLine());
- decimal sum=0m;
- decimal[] array = new decimal[n];
- for(int i = 0; i < n; i++)
- {
- array[i]= decimal.Parse(Console.ReadLine());
- sum += array[i];
- }
- Console.WriteLine("{0}",sum);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement