fork download
  1. #include <iostream>
  2.  
  3. int main()
  4. {
  5. int x;
  6. while((std::cin >> x) && x > 0)
  7. {
  8. std::cout << x << " ";
  9. }
  10. std::cout << "end" << std::endl;
  11. }
  12.  
Success #stdin #stdout 0s 3100KB
stdin
5
4
3
2
1
0
-1
-2
stdout
5 4 3 2 1 end