fork download
  1. namespace Problem_4.Month_Printer
  2. {
  3. using System;
  4.  
  5. public class Program
  6. {
  7. public static void Main()
  8. {
  9. var monthInput = int.Parse(Console.ReadLine());
  10.  
  11.  
  12. switch (monthInput)
  13. {
  14. case 1:
  15. Console.WriteLine("January");
  16. break;
  17. case 2:
  18. Console.WriteLine("February");
  19. break;
  20. case 3:
  21. Console.WriteLine("March");
  22. break;
  23. case 4:
  24. Console.WriteLine("April");
  25. break;
  26. case 5:
  27. Console.WriteLine("May");
  28. break;
  29. case 6:
  30. Console.WriteLine("June");
  31. break;
  32. case 7:
  33. Console.WriteLine("July");
  34. break;
  35. case 8:
  36. Console.WriteLine("August");
  37. break;
  38. case 9:
  39. Console.WriteLine("September");
  40. break;
  41. case 10:
  42. Console.WriteLine("October");
  43. break;
  44. case 11:
  45. Console.WriteLine("November");
  46. break;
  47. case 12:
  48. Console.WriteLine("December");
  49. break;
  50. default:
  51. Console.WriteLine("Error!");
  52. break;
  53. }
  54. }
  55. }
  56. }
Runtime error #stdin #stdout #stderr 0s 135296KB
stdin
Standard input is empty
stdout
Standard output is empty
stderr
Unhandled Exception:
System.ArgumentNullException: Value cannot be null.
Parameter name: String
  at System.Number.StringToNumber (System.String str, System.Globalization.NumberStyles options, System.Number+NumberBuffer& number, System.Globalization.NumberFormatInfo info, System.Boolean parseDecimal) [0x00006] in <8f2c484307284b51944a1a13a14c0266>:0 
  at System.Number.ParseInt32 (System.String s, System.Globalization.NumberStyles style, System.Globalization.NumberFormatInfo info) [0x00014] in <8f2c484307284b51944a1a13a14c0266>:0 
  at System.Int32.Parse (System.String s) [0x00007] in <8f2c484307284b51944a1a13a14c0266>:0 
  at Problem_4.Month_Printer.Program.Main () [0x00005] in <4aa683836b104db192c84153e0ff0211>:0 
[ERROR] FATAL UNHANDLED EXCEPTION: System.ArgumentNullException: Value cannot be null.
Parameter name: String
  at System.Number.StringToNumber (System.String str, System.Globalization.NumberStyles options, System.Number+NumberBuffer& number, System.Globalization.NumberFormatInfo info, System.Boolean parseDecimal) [0x00006] in <8f2c484307284b51944a1a13a14c0266>:0 
  at System.Number.ParseInt32 (System.String s, System.Globalization.NumberStyles style, System.Globalization.NumberFormatInfo info) [0x00014] in <8f2c484307284b51944a1a13a14c0266>:0 
  at System.Int32.Parse (System.String s) [0x00007] in <8f2c484307284b51944a1a13a14c0266>:0 
  at Problem_4.Month_Printer.Program.Main () [0x00005] in <4aa683836b104db192c84153e0ff0211>:0