Advertisement
AziLif

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

May 30th, 2024
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.98 KB | None | 0 0
  1. using System;
  2.  
  3. namespace ConsoleApp
  4. {
  5.     class Program
  6.     {
  7.         static void Main(string[] args)
  8.         {
  9.             int quantityRepeatingPhrase;
  10.             string userPhrase;
  11.  
  12.             Console.WriteLine("Какую бы фразу Вам хотелось увидеть?");
  13.             userPhrase = Console.ReadLine();
  14.            
  15.             Console.WriteLine("Сколько раз нужно ее написать?");
  16.             quantityRepeatingPhrase = Convert.ToInt32(Console.ReadLine());
  17.            
  18.             Console.WriteLine($"Итак Ваша фраза <<{userPhrase}>> и вы хотите ее видеть " +
  19.                               $"<<{quantityRepeatingPhrase}>> раз. Поехали!\n");
  20.  
  21.             for (int i = 0; i < quantityRepeatingPhrase; i++)
  22.             {
  23.                 Console.WriteLine(userPhrase);
  24.             }
  25.            
  26.             Console.WriteLine("\nСпасибо за внимание!");
  27.         }
  28.     }
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement