spasnikolov131

Untitled

Nov 12th, 2021
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.12 KB | None | 0 0
  1. using System;
  2.  
  3. namespace Orders
  4. {
  5. class Program
  6. {
  7. static void Main(string[] args)
  8. {
  9. string command = Console.ReadLine();
  10. int a = int.Parse(Console.ReadLine());
  11. int b = int.Parse(Console.ReadLine());
  12.  
  13. switch(command)
  14. {
  15. case "add":
  16. Add(a, b);
  17. break;
  18. case "divide":
  19. Divide(a, b);
  20. break;
  21. case "subtract":
  22. Subtract(a, b);
  23. break;
  24. case "multiply":
  25. Multiply(a, b);
  26. break;
  27. }
  28.  
  29. }
  30. static void Multiply(int a , int b)
  31. {
  32. Console.WriteLine(a *b);
  33. }
  34. static void Divide(int a, int b)
  35. {
  36. Console.WriteLine(a/b);
  37. }
  38. static void Subtract(int a, int b)
  39. {
  40. Console.WriteLine(a-b);
  41. }
  42. static void Add(int a , int b)
  43. {
  44. Console.WriteLine(a+b);
  45. }
  46. }
  47. }
Advertisement
Add Comment
Please, Sign In to add comment