Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
141530 Kevin 判断身材 C++ Wrong Answer 1 MS 276 KB 921 2025-12-26 20:03:52

Tests(0/3):


Code:

#include <iostream> using namespace std; double calculateStandardWeight(double height) { return (height - 100) * 0.9; } string evaluateBodyShape(double height, double weight) { double stdWeight = calculateStandardWeight(height); if (weight > stdWeight * 1.1) { return "肥胖"; } else if (weight < stdWeight * 0.9) { return "瘦"; } else { return "标准"; } } int main() { double height, weight; cout << "请输入您的身高(厘米):"; cin >> height; cout << "请输入您的体重(千克):"; cin >> weight; if (height <= 0 || weight <= 0) { cout << "输入数据必须大于0,请重新输入。" << endl; return 1; } string result = evaluateBodyShape(height, weight); cout << "\n根据标准体重计算,您的身材状态是: " << result << endl; return 0; }


Run Info:

------Input------
12 12 100 130
------Answer-----
fat
------Your output-----
请输入您的身高(厘米):请输入您的体重(千克): 根据标准体重计算,您的身材状态是: 肥胖