Skip to content

Instantly share code, notes, and snippets.

@QRemark
Created January 10, 2024 08:57
Show Gist options
  • Save QRemark/865c5ed6dee9b5050d6274d80d4d5f70 to your computer and use it in GitHub Desktop.
Save QRemark/865c5ed6dee9b5050d6274d80d4d5f70 to your computer and use it in GitHub Desktop.
Освоение циклов
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