/
Mr_Corrupt
/
SosalVisual
Обзор
Документация
Войти
/
Mr_Corrupt
/
SosalVisual
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
CI/CD
Аналитика
Безопасность
main
Program.cs
34 строки
1 KB
Иванчин Егор Валентинович
Добавлено взаимодействие с пользователем
04 фев 2026, 15:27
04 фев 2026, 15:27
f3b4fc3
Код
Авторство
О чём код?
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace CalculatorApp { internal class Program { static void Main(string[] args) { Console.WriteLine("Калькулятор. Доступные операции: +, -, *"); while (true) { Console.Write("Введите операцию (+, -, *): "); string op = Console.ReadLine(); Console.Write("\nВведите первое число: "); double a = double.Parse(Console.ReadLine()); Console.Write("Введите второе число: "); double b = double.Parse(Console.ReadLine()); double result = 0; switch (op) { case "+": result = Calculator.Sum(a, b); break; case "-": result = Calculator.Substract(a, b); break; case "*": result = Calculator.Multiply(a, b); break; } Console.WriteLine($"Результат: {result}"); } } } }