我测了,当n==2时,只输入得进一个字符串。
大佬帮忙看看,就是读入的问题。
#include<bits/stdc++.h>
using namespace std;
//#define int long long
#define con continue
signed main()
{
int n;
cin>>n;
string s,b="";
if(n==0)//特判
{
cout<<"-1";
return 0;
}
unsigned long long a=0ull;
while(n--)
{
getline(cin,s,'\n');
if(s=="Soul fusion") a+=LLONG_MAX;
if(s=="GERMANY ORTHOPEDICS") a+=300ull;
if(s=="Together FOREVER") a+=100ull;
if(s=="Kiss") a+=50ull;
if(s=="Love") a+=20ull;
if(s=="Like") a+=5ull;
if(s=="Hug") a+=1ull;
if(a==ULLONG_MAX)
{
if(n==1)
{
cout<<"18446744073709551617";
return 0;
}
if(n==2)
{
cout<<"18446744073709551618";
return 0;
}
}
}
if(a>=297ull&&a<=299ull) b="\nYeYan:Oh,There are people like me who are hovering on the edge of German orthopedics!";
cout<<a<<b;
return 0;
}