Advertisement
Guest User

Untitled

a guest
Jan 20th, 2018
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.25 KB | None | 0 0
  1. int a, b, ans;
  2. char operator;
  3.  
  4. a = int.Parse(Console.ReadLine());
  5. b = int.Parse(Console.ReadLine());
  6. operator = char.Parse(Console.ReadLine());
  7.  
  8. switch(operator)
  9. {
  10.     case '+':
  11.         ans = a+b;
  12.         break;
  13.     case '-':
  14.         ans = a-b;
  15.         break;
  16.     ...
  17. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement