Created
January 10, 2024 09:17
-
-
Save QRemark/f22ebd6d5634541c8708ac250bff39f9 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; | |
int repeat; | |
Console.WriteLine( "Добрый день! Введите внизу фразу, которую хотите повторить: "); | |
userInput = Console.ReadLine(); | |
Console.Write("Хорошо, спасибо. Теперь введите пожалуйста количество повторений, " + | |
"число запишите цифрой или цифрами: "); | |
userNumber = Convert.ToInt32(Console.ReadLine()); | |
for (int i = 0; i < userNumber; i++) | |
{ | |
Console.WriteLine(userInput); | |
repeat = userNumber - i - 1; | |
Console.WriteLine($"Оставшееся количество повторений: {repeat}."); | |
} | |
Console.WriteLine("Повторения окончены."); | |
Console.ReadKey(); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment