fork(1) download
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. int main()
  6. {
  7. int l1,l2,ile42=0;
  8.  
  9. while(cin>>l1)
  10. {
  11. if(l1==42)
  12. {
  13. ile42++;
  14. if(ile42==3)
  15. {
  16. break;
  17. }
  18. else
  19. {
  20. l2=l1;
  21. }
  22. }
  23. else
  24. {
  25. ile42=0;
  26. }
  27. cout<<l1<<endl;
  28.  
  29. }
  30. return 0;
  31. }
  32.  
Success #stdin #stdout 0s 4408KB
stdin
Standard input is empty
stdout
Standard output is empty