anizko

03. Sum Numbers

Apr 10th, 2019
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.45 KB | None | 0 0
  1. using System;
  2.  
  3. namespace Sum_Numbers
  4. {
  5.     class Program
  6.     {
  7.         static void Main(string[] args)
  8.         {
  9.             int countNumber = int.Parse(Console.ReadLine());
  10.             double total = 0;
  11.  
  12.             for (int i=1;i<= countNumber;i++)
  13.             {
  14.                 double number = double.Parse(Console.ReadLine());
  15.                 total += number;
  16.             }
  17.  
  18.  
  19.             Console.WriteLine(total);
  20.         }
  21.     }
  22. }
Advertisement
Add Comment
Please, Sign In to add comment