
国家给出了 8 岁男宝宝的标准身高为 130 厘米、标准体重为 27 公斤;8 岁女宝宝的标准身高为 129 厘米、标准体重为 25 公斤。
现在你要根据小宝宝的身高体重,给出补充营养的建议。
输入格式:
输入在第一行给出一个不超过 10 的正整数 N,随后 N 行,每行给出一位宝宝的身体数据:
性别 身高 体重
其中性别是 1 表示男生,0 表示女生。身高和体重都是不超过 200 的正整数。
输出格式:
对于每一位宝宝,在一行中给出你的建议:
- 如果太矮了,输出:
duo chi yu!(多吃鱼); - 如果太瘦了,输出:
duo chi rou!(多吃肉); - 如果正标准,输出:
wan mei!(完美); - 如果太高了,输出:
ni li hai!(你厉害); - 如果太胖了,输出:
shao chi rou!(少吃肉)。
先评价身高,再评价体重。两句话之间要有 1 个空格。
输入样例:
4 0 130 23 1 129 27 1 130 30 0 128 27
输出样例:
ni li hai! duo chi rou! duo chi yu! wan mei! wan mei! shao chi rou! duo chi yu! shao chi rou!
思路:注意中间还有一个空格......
1 #include<iostream>
2 #include<cstdio>
3 #include<cstring>
4 #include<algorithm>
5 #include<map>
6 #include<set>
7 #include<vector>
8 using namespace std; 9 #define ll long long
10 #define dd cout<<endl
11 const int inf=99999999; 12 const int mod=1e9+7; 13 const int maxn=1e5+7; 14 int main() 15 { 16 int T; 17 cin>>T; 18 int sex,high,weight; 19 string shortt="duo chi yu!",thin="duo chi rou!",good="wan mei!",tall="ni li hai!",pang="shao chi rou!"; 20 while(T--) 21 { 22 cin>>sex>>high>>weight; 23 if(sex==1) 24 { 25 if(high>130) 26 cout<<tall<<" "; 27 else if(high==130) 28 cout<<good<<" "; 29 else
30 cout<<shortt<<" "; 31 if(weight>27) 32 cout<<pang<<endl; 33 else if(weight==27) 34 cout<<good<<endl; 35 else
36 cout<<thin<<endl; 37 } 38 else
39 { 40 if(high>129) 41 cout<<tall<<" "; 42 else if(high==129) 43 cout<<good<<" "; 44 else
45 cout<<shortt<<" "; 46 if(weight>25) 47 cout<<pang<<endl; 48 else if(weight==25) 49 cout<<good<<endl; 50 else
51 cout<<thin<<endl; 52 } 53 } 54 return 0; 55 }
