fork(2) download
  1. #include <iostream>
  2. #include <string>
  3. using namespace std;
  4.  
  5. int main()
  6. {
  7. int n = 0;
  8. while(n <= 0) {
  9. cin >> n;
  10. if (!cin.good()) {
  11. cin.clear();
  12. string ignore;
  13. cin >> ignore;
  14. continue;
  15. }
  16. cout << n << endl;
  17. }
  18. return 0;
  19. }
  20.  
Success #stdin #stdout 0s 3276KB
stdin
quick
brown
123
fox
stdout
123