fork download
  1. from sys import stdin
  2.  
  3. for line in stdin:
  4. n = int(line)
  5. if n == 42:
  6. break
  7. print(n,"ok!")
  8.  
Success #stdin #stdout 0.03s 9812KB
stdin
1
2
10
423
11
121
45
42
stdout
1 ok!
2 ok!
10 ok!
423 ok!
11 ok!
121 ok!
45 ok!