7.29
#include<iostream> using namespace std; void boy(int high,int weight); void girl(int high,int weight); int main(){ int N; int sex;//性别 int high;//身高 int weight;//体重 cin>>N; while(N--){ cin>>sex>>high>>weight; if(sex==1) boy(high,weight); if(sex==0) girl(high,weight); } return 0; } void boy(int high,int weight){ if(high<130) cout<<"duo chi yu! "; else if(high==130) cout<<"wan mei! "; else cout<<"ni li hai! "; if(weight<27)
#include<stdio.h> int main() { int N, i, j, sum1, sum2; char num[10]; scanf("%d", &N); for (i = 0; i < N; i++)
#include<stdio.h> int main() { double weight, high, s; scanf("%lf %lf", &weight, &high); s = weight / (high * high); printf("%.1f\n", s); if (s > 25) printf("PANG"); else printf("Hai Xing"); return 0; }
{ scanf("%s", num); sum1 = 0, sum2 = 0; for (j = 0; j < 3; j++) { sum1 += num[j] - '0'; } for (j = 3; j < 6; j++) { sum2 += num[j] - '0'; } if (sum1 == sum2) printf("You are lucky!\n"); else printf("Wish you good luck.\n"); } return 0; }
cout<<"duo chi rou!"<<endl; else if(weight==27) cout<<"wan mei!"<<endl; else cout<<"shao chi rou!"<<endl; } void girl(int high,int weight){ if(high<129) cout<<"duo chi yu! "; else if(high==129) cout<<"wan mei! "; else cout<<"ni li hai! "; if(weight<25) cout<<"duo chi rou!"<<endl; else if(weight==25) cout<<"wan mei!"<<endl; else cout<<"shao chi rou!"<<endl; }