Advertisement
NikaBang

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

May 12th, 2024
570
0
19 days
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.52 KB | None | 0 0
  1. using System;
  2.  
  3. internal class Program
  4. {
  5.     static void Main(string[] args)
  6.     {
  7.         string text;
  8.         int quantityTimes;
  9.  
  10.         Console.Write("Введите сообщение: ");
  11.         text = Console.ReadLine();
  12.  
  13.         Console.Write("Введите число повторений: ");
  14.         quantityTimes = Convert.ToInt32(Console.ReadLine());
  15.  
  16.         for (int i = 0; i < quantityTimes; i++)
  17.         {
  18.             Console.WriteLine(text);
  19.         }
  20.  
  21.         Console.ReadKey();
  22.     }
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement