Advertisement
Rodunskiy

Untitled

Apr 7th, 2023
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.52 KB | None | 0 0
  1. string userInput;
  2. int repeat;
  3.  
  4. Console.Write("Введите кол-во повторений:");
  5. repeat = Convert.ToInt32(Console.ReadLine());
  6.  
  7. while (repeat-- > 0)
  8. {
  9.     Console.Write("Введите сообщение:");
  10.     userInput = Console.ReadLine();
  11.  
  12.     if (userInput == "exit")
  13.     {
  14.         Console.WriteLine("Выход из цикла");
  15.         break;
  16.     }
  17.  
  18.     Console.WriteLine(userInput);
  19.     Console.WriteLine("Если хотите закончить цикл введите 'exit'.");
  20.  
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement