fork download
  1. #include <iostream>
  2. #include <string>
  3. using namespace std;
  4.  
  5. string ask(){
  6. string ans2;
  7. cout << "Type:";
  8. cin >> ans2;
  9. return ans2;
  10.  
  11. }
  12.  
  13. int main()
  14. {
  15. string ans2;
  16. string ans1="Hello";
  17. ans2 = ask();
  18. cout << ans1 << " turns into " << ans2;
  19. return 0;
  20. }
Success #stdin #stdout 0s 3460KB
stdin
test
stdout
Type:Hello turns into test