fork download
  1. #include <iostream>
  2. using namespace std; // consider removing this line in serious projects
  3.  
  4. int main() {
  5. int intNum = 0;
  6.  
  7. cin >> intNum;
  8. while (intNum != 42) {
  9. cout << intNum << "\n";
  10. cin >> intNum;
  11. }
  12.  
  13. return 0;
  14. }
Success #stdin #stdout 0.01s 5268KB
stdin
1
2
10
42
11
stdout
1
2
10