fork(5) download
  1. #include <iostream>
  2.  
  3. int main() {
  4.  
  5. std::string line;
  6. while ( getline( std::cin, line ) ) {
  7. if ( ! line.empty() ) {
  8. std::cout << line << '\n';
  9. }
  10. }
  11.  
  12. }
Success #stdin #stdout 0.02s 2816KB
stdin
hello,

world!
(one more line)
stdout
hello,
world!
(one more line)