fork download
  1. using System;
  2. using System.Collections;
  3.  
  4. public class Test
  5. {
  6. public static IEnumerable Count(int to)
  7. {
  8. int from = 1;
  9. while (from <= to)
  10. yield return from++;
  11. yield return "hello world";
  12. }
  13.  
  14. public static void Main()
  15. {
  16. foreach (int i in Count(5))
  17. Console.WriteLine(i);
  18. }
  19. }
Runtime error #stdin #stdout #stderr 0.02s 14008KB
stdin
Standard input is empty
stdout
1
2
3
4
5
stderr
Unhandled Exception:
System.InvalidCastException: Specified cast is not valid.
  at Test.Main () [0x00017] in <ff423e5b926846c5aca02d52fa63770c>:0 
[ERROR] FATAL UNHANDLED EXCEPTION: System.InvalidCastException: Specified cast is not valid.
  at Test.Main () [0x00017] in <ff423e5b926846c5aca02d52fa63770c>:0