瀏覽代碼

создал новый репозиторий

Gataullin Bulat 2 年之前
當前提交
e4ec6a5037
共有 1 個文件被更改,包括 22 次插入0 次删除
  1. 22 0
      lab9.cs

+ 22 - 0
lab9.cs

@@ -0,0 +1,22 @@
+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();
+        }
+    }
+}
+