fork(3) download
  1. using System;
  2.  
  3. namespace ConsoleApp10
  4. {
  5. class Program
  6. {
  7. static void Main()
  8. {
  9.  
  10. for (int i=0; i<100; i++)
  11. {
  12. string s = Console.ReadLine();
  13. string[] tab = s.Split(' ');
  14.  
  15.  
  16. int wynik = 0;
  17. string a = (tab[0]);
  18. int b = int.Parse(tab[1]);
  19. int c = int.Parse(tab[2]);
  20.  
  21. switch (a)
  22. {
  23. case "+":
  24. wynik = b + c;
  25. Console.WriteLine(wynik);
  26. break;
  27.  
  28. case "-":
  29. wynik = b - c;
  30. Console.WriteLine(wynik);
  31. break;
  32.  
  33. case "*":
  34. wynik = b * c;
  35. Console.WriteLine(wynik);
  36. break;
  37.  
  38. case "/":
  39. wynik = b / c;
  40. Console.WriteLine(wynik);
  41. break;
  42.  
  43. case "%":
  44. wynik = b % c;
  45. Console.WriteLine(wynik);
  46. break;
  47.  
  48. default:
  49. break;
  50.  
  51. }
  52.  
  53. }
  54.  
  55.  
  56. }
  57.  
  58. }
  59. }
  60.  
Runtime error #stdin #stdout #stderr 0.03s 22724KB
stdin
+ 7 9
- 0 4
* 5 6
/ 8 3
% 5 2
stdout
16
-4
30
2
1
stderr
Unhandled Exception:
System.NullReferenceException: Object reference not set to an instance of an object
  at ConsoleApp10.Program.Main () [0x0000d] in <ca4588d9247b45068fea5ac488f93f94>:0 
[ERROR] FATAL UNHANDLED EXCEPTION: System.NullReferenceException: Object reference not set to an instance of an object
  at ConsoleApp10.Program.Main () [0x0000d] in <ca4588d9247b45068fea5ac488f93f94>:0