Advertisement
Legiomax

C#_2_lesson_repeat_message

Jan 3rd, 2024
594
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.73 KB | Software | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6.  
  7. namespace C_Ijun
  8. {
  9.     internal class Program
  10.     {
  11.         static void Main(string[] args)
  12.         {
  13.             Console.Write("Введите сообщение: ");
  14.             string userMessage = Console.ReadLine();
  15.  
  16.             Console.Write("Введите количество повторов вывода сообщения: ");
  17.             int countOfRepeatMessage = Convert.ToInt32(Console.ReadLine());
  18.  
  19.             for (int i = 0; i < countOfRepeatMessage; i++)
  20.             {
  21.                 Console.WriteLine(userMessage);
  22.             }
  23.             Console.ReadLine();
  24.         }
  25.     }
  26. }
  27.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement