L1-035 情人节 (15分) 详解

思路:

 这道题挺简单的,就是统计名字数量而已。纯粹就是这道题的题目让我虎躯一震,挺有意思的哈哈哈

情人节VIP专属题目

#include<iostream>
#include<vector>
#include<string>
using namespace std;
int main()
{

	vector<string> a;
	string s;
	cin >> s;
	while (!(s == "."))
	{
		a.push_back(s);
		cin >> s;
	}
	if (a.size() >= 14)
	{
		cout << a[1]<<" and "<<a[13]<<" are inviting you to dinner..." << endl;
	}
	else if (a.size() < 14&&a.size()>1)
	{
		cout << a[1]<<" is the only one for you..." << endl;
	}
	else if (a.size() < 2)
	{
		cout << "Momo... No one is for you ...";
	}
	system("pause");
	return 0;
}

猜你喜欢

转载自blog.csdn.net/weixin_43535668/article/details/104525330