fork download
#include 
#include 
#include 
#include 

using namespace std;

int main() {
	string temp;
	while(getline(cin, temp))
	{
		string name, t;
		vector reqs;
		stringstream ss(temp);
		ss >> name;
		while(ss >> t)
		{
			reqs.push_back(t);
		}
		cout << name;
		for(const auto& a : reqs)
			cout << " " << a;
		cout << endl;
	}
}
Success #stdin #stdout 0s 3436KB
stdin
gameDesign java cs3
java cs1
cSharp cs1
cs1 cs0
discreteMath
dataBases
cs2 cs1
advancedGraphics
cs3 cs2
operatingSystems
graphics cs3 operatingSystems
cs0 mathForKids
cs4 cs3 dataBases operatingSystems
bioinformatics discreteMath cs2
assembly cs1
mathForKids
stdout
gameDesign java cs3
java cs1
cSharp cs1
cs1 cs0
discreteMath
dataBases
cs2 cs1
advancedGraphics
cs3 cs2
operatingSystems
graphics cs3 operatingSystems
cs0 mathForKids
cs4 cs3 dataBases operatingSystems
bioinformatics discreteMath cs2
assembly cs1
mathForKids