fork download
  1. #include <iostream>
  2. #include <string>
  3.  
  4. using namespace std;
  5.  
  6. int main() {
  7. // your code goes here
  8. std::string s = "D:\Home\My folder";
  9. std::string s2;
  10. getline(cin, s2);
  11. cout << "The length of s is " << s.length() << "\n" << "The string is: " << s << "\n";
  12. cout << "The length of s2 is " << s2.length() << "\n" << "The string is: " << s2;
  13. return 0;
  14. }
Success #stdin #stdout 0s 3276KB
stdin
D:\Home\My folder
stdout
The length of s is 15
The string is: D:HomeMy folder
The length of s2 is 17
The string is: D:\Home\My folder