12345678910111213141516171819202122 |
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace lab_9
- {
- class Program
- {
- static void Main(string[] args)
- {
- Console.WriteLine("Введите число заканчивающиеся нулём");//надпись
- int sum;
- for (sum = 0; int.TryParse(Console.ReadLine(), out int n); sum += n) ;
- Console.WriteLine($"Сумма введёных чисел:{sum}");
- Console.ReadKey();
- }
- }
- }
|