Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace Orders
- {
- class Program
- {
- static void Main(string[] args)
- {
- string command = Console.ReadLine();
- int a = int.Parse(Console.ReadLine());
- int b = int.Parse(Console.ReadLine());
- switch(command)
- {
- case "add":
- Add(a, b);
- break;
- case "divide":
- Divide(a, b);
- break;
- case "subtract":
- Subtract(a, b);
- break;
- case "multiply":
- Multiply(a, b);
- break;
- }
- }
- static void Multiply(int a , int b)
- {
- Console.WriteLine(a *b);
- }
- static void Divide(int a, int b)
- {
- Console.WriteLine(a/b);
- }
- static void Subtract(int a, int b)
- {
- Console.WriteLine(a-b);
- }
- static void Add(int a , int b)
- {
- Console.WriteLine(a+b);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment