fork(1) download
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5.  
  6. namespace ConsoleApplication1
  7. {
  8. class Program
  9. {
  10. static void Main(string[] args)
  11. {
  12. for (; ; )
  13. {
  14. var cab = Console.ReadLine().Split(null);
  15. char c = char.Parse(cab[0]);
  16. Int32 a = Int32.Parse(cab[1]);
  17. Int32 b = Int32.Parse(cab[2]);
  18.  
  19.  
  20.  
  21. switch (c)
  22. {
  23. case '+': Console.WriteLine(a + b); break;
  24. case '-': Console.WriteLine(a - b); break;
  25. case '*': Console.WriteLine(a * b); break;
  26. case '/': Console.WriteLine(a / b); break;
  27. case '%': Console.WriteLine(a % b); break;
  28. }
  29. }
  30. Console.ReadKey();
  31.  
  32. }
  33. }
  34. }
  35.  
Runtime error #stdin #stdout #stderr 0.01s 32744KB
stdin
+ 7 9
- 0 4
* 5 6
/ 8 3
% 5 2
+ 7 9
- 0 4
* 5 6
/ 8 3
% 5 2
stdout
16
-4
30
2
1
16
-4
30
2
1
stderr
Unhandled Exception:
System.NullReferenceException: Object reference not set to an instance of an object
  at ConsoleApplication1.Program.Main (System.String[] args) [0x00000] in <filename unknown>:0 
[ERROR] FATAL UNHANDLED EXCEPTION: System.NullReferenceException: Object reference not set to an instance of an object
  at ConsoleApplication1.Program.Main (System.String[] args) [0x00000] in <filename unknown>:0