AdemDev

Освоение циклов

Aug 30th, 2023 (edited)
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.59 KB | None | 0 0
  1. using System;
  2.  
  3. namespace ConsoleApp
  4. {
  5. internal class Program
  6. {
  7. static void Main(string[] args)
  8. {
  9. string message;
  10. int repeatCount;
  11.  
  12. Console.Write("Введите сообщение: ");
  13. message = Console.ReadLine();
  14.  
  15. Console.Write("Сколько раз вывести сообщение? ");
  16. repeatCount = Convert.ToInt32(Console.ReadLine());
  17.  
  18. for (int i = 0; i < repeatCount; i++)
  19. {
  20. Console.WriteLine(message);
  21. }
  22. }
  23. }
  24. }
Advertisement
Add Comment
Please, Sign In to add comment