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