knikolov98

Untitled

Sep 25th, 2019
61
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 SumNumbers
  4. {
  5.     class Program
  6.     {
  7.         static void Main(string[] args)
  8.         {
  9.             int num = int.Parse(Console.ReadLine());
  10.             int currentNum = 0;
  11.             int sum = 0;
  12.  
  13.             for (int i = 0; i < num; i++)
  14.             {
  15.                 currentNum = int.Parse(Console.ReadLine());
  16.                 sum += currentNum;
  17.             }
  18.  
  19.             Console.WriteLine(sum);
  20.         }
  21.     }
  22. }
Add Comment
Please, Sign In to add comment