fork download
  1. #include <iostream>
  2. #include <string>
  3.  
  4. using std::string;
  5. using std::cin;
  6. using std::cout;
  7. using std::endl;
  8.  
  9. int main()
  10. {
  11. string concatenated;
  12. for (string buffer; cin >> buffer; concatenated += buffer);
  13. cout << "The concatenated string is " << concatenated << endl;
  14.  
  15. return 0;
  16. }
Success #stdin #stdout 0s 4384KB
stdin
Hello there...
How are you?
Are you ok?
stdout
The concatenated string is Hellothere...Howareyou?Areyouok?