Skip to content

Instantly share code, notes, and snippets.

@Strelok78
Last active April 2, 2025 14:18
Show Gist options
  • Save Strelok78/cb6cb389879b11666decd47fee6dd44d to your computer and use it in GitHub Desktop.
Save Strelok78/cb6cb389879b11666decd47fee6dd44d to your computer and use it in GitHub Desktop.
Вывод сообщения пользователя кол-во раз заданное пользователем
namespace iJuniorPractice;
class Program
{
static void Main(string[] args)
{
string userMessage;
string messageRequestText = "Введите сообщение: ";
string messageRepeatCountRequestText = "Введите кол-во повторений сообщения: ";
int messageRepeatCount;
Console.Write(messageRequestText);
userMessage = Console.ReadLine();
Console.Write(messageRepeatCountRequestText);
messageRepeatCount = int.Parse(Console.ReadLine());
for (int i = 0; i < messageRepeatCount; i++)
{
Console.WriteLine(userMessage);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment