fork download
  1. #include <iostream>
  2.  
  3. int main() {
  4.  
  5. std::string name;
  6. int age;
  7.  
  8. std::cout << "What's your name?: \n";
  9. std::getline(std::cin, name);
  10. std::cout << "How old are you?: \n";
  11. std::cin >> age;
  12.  
  13. std::cout << "Hello " << name << '\n';
  14. std::cout << "You are " << age << " years old\n";
  15.  
  16. for (int i = 5; i > 0; i--) {
  17. std::cout << "Launch in "<< i << '\n';
  18. }
  19.  
  20. std::cout << "Blastoff!";
  21.  
  22. return 0;
  23. }
Success #stdin #stdout 0.01s 5308KB
stdin
Forest Zang
17
stdout
What's your name?: 
How old are you?: 
Hello Forest Zang
You are 17 years old
Launch in 5
Launch in 4
Launch in 3
Launch in 2
Launch in 1
Blastoff!