fork(1) download
  1. using System;
  2.  
  3. namespace test_3
  4. {
  5. class Program
  6. {
  7. public static void Main(string[] args)
  8. {
  9. int a = 0;
  10. bool b = false;
  11. int c = 0;
  12.  
  13. while(c != 3)
  14. {
  15. a = int.Parse(Console.ReadLine());
  16. Console.WriteLine(a);
  17.  
  18. if(a!=42)
  19. {
  20. b = true;
  21. }
  22.  
  23. if(a == 42 && b == true)
  24. {
  25. c++;
  26. b = false;
  27. }
  28. }
  29. }
  30. }
  31. }
Success #stdin #stdout 0.02s 22448KB
stdin
42
42
12
13
42
11
42
43
42
42
99
01
3
42
3
42
3
3
3
stdout
42
42
12
13
42
11
42
43
42