Advertisement
dragonbs

Sum Numbers

Oct 23rd, 2022
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.44 KB | None | 0 0
  1. using System;
  2.  
  3. namespace _03.SumNumbers
  4. {
  5.     internal class Program
  6.     {
  7.         static void Main(string[] args)
  8.         {
  9.             int mainNumberR = int.Parse(Console.ReadLine());
  10.             int sum = 0;
  11.             while (mainNumberR > sum)
  12.             {
  13.                 int newNumberR = int.Parse(Console.ReadLine());
  14.                 sum += newNumberR;
  15.             }
  16.             Console.WriteLine(sum);
  17.         }
  18.     }
  19. }
  20.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement