Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace SumNumbers
- {
- class Program
- {
- static void Main(string[] args)
- {
- int n = int.Parse(Console.ReadLine());
- int result = 0;
- for (int i = 1; i < n; i++)
- {
- int number = int.Parse(Console.ReadLine());
- result += number;
- if (result >= n)
- {
- break;
- }
- }
- Console.WriteLine($"{result}");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment