fork download
  1. #include <iostream>
  2. #include <vector>
  3. #include <string>
  4.  
  5. using namespace std;
  6.  
  7. int main() {
  8. vector<string> jwords, ewords;
  9. string j, e;
  10. while(cin >> j && cin >> e)
  11. {
  12. jwords.push_back(j);
  13. ewords.push_back(e);
  14. }
  15.  
  16. for(int e = 0, j = 0; e < ewords.size() && j < jwords.size(); ++e, ++j)
  17. {
  18. cout << ewords[e] << ' ' << jwords[j] << endl;
  19. }
  20. }
Success #stdin #stdout 0s 3436KB
stdin
tomodachi friend
denwa telephone
denchi battery
neko cat
stdout
friend tomodachi
telephone denwa
battery denchi
cat neko