fork download
#include 
#include 
#include 

using namespace std;

int main() {
	vector jwords, ewords;
	string j, e;
	while(cin >> j && cin >> e)
	{
		jwords.push_back(j);
		ewords.push_back(e);
	}

	for(int e = 0, j = 0; e < ewords.size() && j < jwords.size(); ++e, ++j)
	{
		cout << ewords[e] << ' ' << jwords[j] << endl;
	}
}
Success #stdin #stdout 0s 3436KB
stdin
tomodachi friend
denwa telephone
denchi battery
neko cat
stdout
friend tomodachi
telephone denwa
battery denchi
cat neko