fork download
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. int main()
  6. {
  7. int i = 0;
  8.  
  9. // read numbers from the user until 42 is entered
  10.  
  11. while (i!=42)
  12. {
  13. cin >> i;
  14. cout << "i = " << i << endl;
  15. }
  16.  
  17. return 0;
  18. }
Success #stdin #stdout 0.02s 2684KB
stdin
9 3 8 5 1 4 42 13 985
stdout
i = 9
i = 3
i = 8
i = 5
i = 1
i = 4
i = 42