1111

Gooooogle  •  10个月前


#include <iostream>
#include <list>
#include <string>
using namespace std;

int main() {
	list<string>l;
	string x;
	getline(cin, x);
	while (x != "end") {
		l.push_front(x);
		getline(cin, x);
	}
	for (auto i = l.begin( ); i != l.end( ); i++ ) {
		cout << *i << endl;
	}
	return 0;
}

评论:

请先登录,才能进行评论