Advertisement
KrasenPenev

even oddd

Jan 30th, 2020
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.13 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6.  
  7. namespace Operations_Between_Numbers
  8. {
  9. class Program
  10. {
  11. static void Main(string[] args)
  12. {
  13. int N1 = int.Parse(Console.ReadLine());
  14. int N2 = int.Parse(Console.ReadLine());
  15. string operatorOne = Console.ReadLine();
  16. int result = 0;
  17. string operatorTwo = "";
  18.  
  19. if ((operatorOne=="+") || (operatorOne=="-") ||(operatorOne=="*"))
  20. {
  21. if (operatorOne=="+")
  22. {
  23. result = N1 + N2;
  24. operatorTwo = "+";
  25. }
  26. else if (operatorOne=="-")
  27. {
  28. result = N1 - N2;
  29. operatorTwo = "-";
  30. }
  31. else if (operatorOne=="*")
  32. {
  33. result = N1 * N2;
  34. operatorTwo = "*";
  35. }
  36.  
  37. }
  38. Console.WriteLine($"{N1} {operatorTwo} {N2} = {result} ");
  39.  
  40. }
  41. }
  42. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement