Created
January 10, 2024 08:57
-
-
Save QRemark/865c5ed6dee9b5050d6274d80d4d5f70 to your computer and use it in GitHub Desktop.
Освоение циклов
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Text; | |
using System.Threading.Tasks; | |
namespace homeWork2 | |
{ | |
internal class Program | |
{ | |
static void Main(string[] args) | |
{ | |
string userInput; | |
int userNumber; | |
Console.WriteLine( "Добрый день! Введите внизу фразу, которую хотите повторить: "); | |
userInput = Console.ReadLine(); | |
Console.Write("Хорошо, спасибо. Теперь введите пожалуйста количество повторений, " + | |
"число запишите цифрой или цифрами: "); | |
userNumber = Convert.ToInt32(Console.ReadLine()); | |
for (int i = 1; i <= userNumber; i++) | |
{ | |
Console.WriteLine(userInput); | |
Console.WriteLine($"Оставшееся количество повторений: {userNumber - i}."); | |
} | |
Console.WriteLine("Повторения окончены."); | |
Console.ReadKey(); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment