Skip to content

Instantly share code, notes, and snippets.

@tsk-arh
Last active January 7, 2024 08:17
Show Gist options
  • Save tsk-arh/ec23736c8f7cf904f2ac9feccf3dc137 to your computer and use it in GitHub Desktop.
Save tsk-arh/ec23736c8f7cf904f2ac9feccf3dc137 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 ConsoleApp4
{
internal class Program
{
static void Main(string[] args)
{
string password = "";
string key = "exit";
int argument = 1;
int factor = 3;
int result;
result = argument;
while (password != key)
{
if (argument != result)
{
Console.WriteLine("Правильный ответ был " + result);
}
Console.WriteLine($"{result}*{factor} = ?");
result *= factor;
Console.WriteLine($"Для продолжения работы нажмите ввод, для завершения программы введите: {key}");
password = Console.ReadLine();
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment