fork download
  1. #include <iostream>
  2. #include <string>
  3.  
  4. using namespace std;
  5.  
  6. int main()
  7. {
  8. string first;
  9. string last;
  10.  
  11. // read the two strings from input
  12.  
  13. cin >> first;
  14. cin >> last;
  15.  
  16. // print out the greeting
  17.  
  18. cout << "Hello " << first << " " << last << endl;
  19. cout << "Your first name is " << first << endl;
  20. cout << "Your last name is " << last << endl;
  21.  
  22. // return 0 from main
  23.  
  24. return 0;
  25. }
Success #stdin #stdout 0.01s 2816KB
stdin
Homer Simpson
stdout
Hello Homer Simpson
Your first name is Homer
Your last name is Simpson