L1-035 情人节 (15分)
题目详情:
AC代码:
#include<iostream>
using namespace std;
int main()
{
string str,s1,s2;
int num=0;
while(cin>>str&&str!=".")
{
num++;
if(num==2)
s1=str;//第二个人赋值到s1
if(num==14)
s2=str;//第14个人赋值给s2
}
if(num<2)
cout<<"Momo... No one is for you ..."<<endl;
else if(num<14)
cout<<s1<<" is the only one for you..."<<endl;
else
cout<<s1<<" and "<<s2<<" are inviting you to dinner..."<<endl;
return 0;
}
永远相信美好🎈