P17466 [ICPC 2018 Jiaozuo R] Xu Xiake in Henan Province 题解

题目大意

旅行者的等级均可根据其游览过的景点数量进行分类:

  1. 游览过恰好 \(0\) 个上述景点的旅行者为 Typically Otaku。

  2. 游览过恰好 \(1\) 个上述景点的旅行者为 Eye-opener。

  3. 游览过恰好 \(2\) 个上述景点的旅行者为 Young Traveller。

  4. 游览过恰好 \(3\) 个上述景点的旅行者为 Excellent Traveller。

  5. 游览过全部 \(4\) 个上述景点的旅行者为 Contemporary Xu Xiake。

请识别一位旅行者的等级。

简化题意

给你四个自然数。

  1. 如果其中有 \(0\) 个正数输出 Typically Otaku。

  2. 如果其中有 \(1\) 个正数输出 Eye-opener。

  3. 如果其中有 \(2\) 个正数输出 Young Traveller。

  4. 如果其中有 \(3\) 个正数输出 Excellent Traveller。

  5. 如果其中有 \(4\) 个正数输出 Contemporary Xu Xiake。

#include<bits/stdc++.h>
using namespace std;
string s[6]={"Typically Otaku","Eye-opener","Young Traveller","Excellent Traveller","Contemporary Xu Xiake"};
int main(){
	ios::sync_with_stdio(0);
	cin.tie(0),cout.tie(0);
  int T;cin>>T;//注意多测
  while(T--){
    int a,b,c,d;cin>>a>>b>>c>>d;
    int ans=(a>0)+(b>0)+(c>0)+(d>0);//判断是否为正数
    cout<<s[ans]<<'\n';
  }
}
posted @ 2026-10-17 18:52  SCX2014  阅读(3)  评论(0)    收藏  举报