Neon1x1st

1112

Dec 22nd, 2021
1,225
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.00 KB | None | 0 0
  1. using System;
  2. using System.Linq;
  3. using System.Collections.Generic;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6. namespace CSharpLight
  7. {
  8.  
  9.     public static class Program
  10.     {
  11.         public static void Main()
  12.         {
  13.             Console.WriteLine("Введите сообщение");
  14.             string message = Console.ReadLine();
  15.             while (!message.Contains("exit"))
  16.             {
  17.                 if (message != "exit")
  18.                 {
  19.                     Console.Write("Введите количество повторов сообщения: ");
  20.                     int repeat = int.Parse(Console.ReadLine());
  21.                     for (int i = 0; i < repeat; i++)
  22.                     {
  23.                         Console.WriteLine(message);
  24.                     }
  25.                     Console.WriteLine("Повторить операцию или exit для выхода");
  26.                     message = Console.ReadLine();
  27.                 }
  28.             }
  29.         }
  30.     }
  31. }
Advertisement
Add Comment
Please, Sign In to add comment