fork download
  1. #include <iostream>
  2. #include <cmath>
  3. #include <numeric>
  4. #include <string>
  5. using namespace std;
  6.  
  7. void solve()
  8. {
  9. string s1, s2;
  10. cout << "first: ";
  11. cin >> s1;
  12. cout << s1 << endl;
  13. cin.sync();
  14. cout << "second: ";
  15. cin >> s2;
  16. cout << s2 << endl;
  17.  
  18. }
  19.  
  20. int main(){
  21. solve();
  22. return 0;
  23. }
Success #stdin #stdout 0.01s 5276KB
stdin
abdullah mohamed
stdout
first: abdullah
second: mohamed