fork download
  1. #include <iostream>
  2. #include <string>
  3.  
  4. int main()
  5. {
  6. std::cout << "What is your name?\n";
  7. std::string name;
  8. std::getline(std::cin, name);
  9. std::cout << "Hello, " << name << "!\n";
  10. return 0;
  11. }
  12.  
Success #stdin #stdout 0s 15232KB
stdin
Ben Key
stdout
What is your name?
Hello, Ben Key!