BMI heightcm weightkg 2 n BMI weight height100
Sign up to view full document!
SIGN UP
隨堂練習一 求BMI 【輸入】身高(height、單位cm), 體重(weight、單位kg) 【運算式】 2 n BMI = weight / (height/100) n BMI = weight / (height /100* height/100) 【輸出】BMI的值
一元二次方式程參考程式碼 #include <iostream> #include <cstdlib> #include <cmath> using namespace std; int main() { int a, b, c; float x 1, x 2 , d; cout << "請輸入一元二次方程式的三個係數a, b, c:" << endl; … … … d = pow(b, 2. 0) – 4*a*c; x 1 = …………; x 2 = …………; cout << "ax 2+bx+c=0 的兩個根為:" … … ; system(" pause"); return 0; }
- Slides: 13