fork(8) download
  1. #include <iostream>
  2. #include <string>
  3.  
  4. int main() {
  5. std::string input;
  6. while (std::cin) {
  7. std::cout << "Type something in:\n";
  8. std::getline(std::cin, input);
  9. if(input.empty())
  10. continue;
  11. std::cout << "You typed [" << input << "]\n";
  12. }
  13. std::cout << "Our work here is done.\n";
  14.  
  15. return 0;
  16. }
Success #stdin #stdout 0s 3476KB
stdin
hey
ho
and up she rises
early in the morning
stdout
Type something in:
You typed [hey]
Type something in:
You typed [ho]
Type something in:
You typed [and up she rises]
Type something in:
You typed [early in the morning]
Type something in:
Our work here is done.