酷代码 AI
菜单
服务商

C 语言实现依据标准为 8 岁宝宝身高体重提供营养建议

```c #include <stdio.h> int main() { int n; scanf("%d", &n); for (int i = 0; i < n; i++) { int gender, height, weight; scanf("%d %d %d", &gender, &height, &weight); if (gender == 1) { // 男生 if (height < 130) { printf("duo chi yu! "); } else if (height > 130) { printf("ni li hai! "); } else { printf("wan mei! "); } if (weight < 27) { printf("duo chi rou!\n"); } else if (weight > 27) { printf("shao chi rou!\n"); } else { printf("wan mei!\n"); } } else { // 女生 if (height < 129) { printf("duo chi yu! "); } else if (height > 129) { printf("ni li hai! "); } else { printf("wan mei! "); } if (weight < 25) { printf("duo chi rou!\n"); } else if (weight > 25) { printf("shao chi rou!\n"); } else { printf("wan mei!\n"); } } } return 0; } ``` ######[AI写代码神器 | 365点数解答 | 2024-10-30 16:30:00]

相关提问
本站限时免费提问中
实用工具查看更多
Linux在线手册 [开发类]
Jquery在线手册 [开发类]
今日油价 [生活类]
图片互转base64 [开发类]
时间转换器 [开发类]