Console calculator. Очистка консоли - C#
Формулировка задачи:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Project1
{
class Class1
{
static int operation;
static void Main(string[] args)
{
var a = int.Parse(Console.ReadLine());
char operation1 = char.Parse(Console.ReadLine());
var b = int.Parse(Console.ReadLine());
if(operation1 == '+')
{
operation = a + b;
}
else if(operation1 == '-')
{
operation = a - b;
}
else if (operation1 == '*')
{
operation = a * b;
}
else if (operation1 == '/')
{
operation = a / b;
};
if(если нажать c) <<<<<<<<<< Как это написать ??
{
Console.Clear();
}
Console.WriteLine(operation);
Console.ReadLine();
}
}
}Решение задачи: «Console calculator. Очистка консоли»
textual
Листинг программы
if(Console.ReadKey().Key==ConsoleKey.C)
{
Console.Clear();
}