solution.cpp 410 字节
Newer Older
每日一练社区's avatar
每日一练社区 已提交
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
#include <iostream>
#include <vector>
using namespace std;
int main()
{
	vector<char> vc1;
	int i;
	for (i = 0; i < 2014; i++)
		vc1.push_back('a' + (i % 19));
	while (vc1.size() != 1)
	{
		vector<char> vc2;
		cout << vc1.size() << endl;
		for (i = 1; i < vc1.size(); i += 2)
			vc2.push_back(vc1[i]);
		vc1.assign(vc2.begin(), vc2.end());
		cout << vc1.size() << endl;
	}
	cout << vc1[0] << endl;
	return 0;
}