#include <iostream>#include <string> int main() { std::string input; while (std::cin) { std::cout << "Type something in:\n"; std::getline(std::cin, input); if(input.empty()) continue; std::cout << "You typed [" << input << "]\n"; } std::cout << "Our work here is done.\n"; return 0;}
hey ho and up she rises early in the morning
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.
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!