这题主要用数组存放0(也就是没去过地方的数量)的个数,然后按题目要求对应输出就能完成。最后附上代码。
#include<iostream>
using namespace std;
int main()
{
int n,flag;
cin>>n;
int a[n][4],b[n];
for(int i=0;i<n;i++)
{
b[i]=0,flag=0;
for(int j=0;j<4;j++)
{
scanf("%d",&a[i][j]);
if(a[i][j]==0)
{
b[i]++;
}
}
}
for(int i=0;i<n;i++)
{
if(b[i]==4)
{
cout<<"Typically Otaku"<<endl;
}
if(b[i]==3)
{
cout<<"Eye-opener"<<endl;
}
if(b[i]==2)
{
cout<<"Young Traveller"<<endl;
}
if(b[i]==1)
{
cout<<"Excellent Traveller"<<endl;
}
if(b[i]==0)
{
cout<<"Contemporary Xu Xiake"<<endl;
}
}
return 0;
}