L1-063 吃魚還是吃肉


fish.JPG 肉.JPG

國家給出了 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 }

 

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM