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