fork download
  1. #include <iostream>
  2. #include <string>
  3.  
  4. using namespace std;
  5.  
  6. int main()
  7. {
  8. string first = "Bart";
  9. string last = "Simpson";
  10. string both = first + " " + last;
  11.  
  12. cout << "Hello " << both << endl;
  13. cout << "Your first name is " << first << endl;
  14. cout << "Your last name is " << last << endl;
  15.  
  16. return 0;
  17. }
Success #stdin #stdout 0.01s 2856KB
stdin
Standard input is empty
stdout
Hello Bart Simpson
Your first name is Bart
Your last name is Simpson