c006: 設計身體質量指數(BMI)的計算程式
Tags : C++
Accepted rate : 1人/1人 ( 100% ) [非即時]
評分方式:
Tolerant

最近更新 : 2022-11-16 14:16

Content

計算BMI程式碼:

#include <iostream>
using namespace std;
int main()
{
    float height;
    float weight;
    cout << "請輸入身高(公尺):";
    cin >> height;
    cout << "請輸入體重(公斤):";
    cin >> weight;
    float BMI = weight / (height*height);
    cout << "BMI = " << BMI;
    return 0;
}

Input
Output
Sample Input #1
1.87
84
Sample Output #1
請輸入身高(公尺):請輸入體重(公斤):BMI = 24.0213
測資資訊:
記憶體限制: 64 MB
公開 測資點#0 (100%): 1.0s , <1K
Hint :
Tags:
C++
出處:
育達技高資訊科技 [管理者: zero(育達管理員) ]


ID User Problem Subject Hit Post Date
沒有發現任何「解題報告」