Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- namespace Homework2
- {
- using System;
- public class Problem
- {
- public static void Main()
- {
- int num1 = int.Parse(Console.ReadLine());
- string operation = Console.ReadLine();
- int num2 = int.Parse(Console.ReadLine());
- int result = 0;
- switch (operation)
- {
- case "+":
- result += num1 + num2;
- break;
- case "-":
- result += num1 - num2;
- break;
- case "*":
- result += num1 * num2;
- break;
- case "/":
- result += num1 / num2;
- break;
- }
- Console.WriteLine(num1 + " " + operation + " " + num2 + " = " + result);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement