1
0

20_stltextinput.cpp 354 B

12345678910111213141516
  1. #include <iostream>
  2. #include <string>
  3. using namespace std;
  4. int main()
  5. {
  6. string str;
  7. cout << "Enter some string:" << endl;
  8. getline(cin, str);
  9. cout << "Entered string is: \"" << str << "\"" << endl;
  10. cout << "Its length is " << str.size() << endl;
  11. string str2 = str + str;
  12. cout << "Doubled input string is \"" << str2 << "\"" << endl;
  13. return 0;
  14. }