fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main() {
  5. int height, weight;
  6. cin >> height >> weight;
  7.  
  8. // Tính chỉ số BMI
  9. double BMI = (double)weight / (height * height);
  10.  
  11. // So sánh BMI để đưa ra kết quả
  12. if (BMI < 0.00185) {
  13. cout << "Thieu can" << endl;
  14. } else if (BMI >= 0.00185 && BMI < 0.0025) {
  15. cout << "Trung binh" << endl;
  16. } else if (BMI >= 0.0025 && BMI < 0.003) {
  17. cout << "Thua can" << endl;
  18. } else {
  19. cout << "Beo phi" << endl;
  20. }
  21.  
  22. return 0;
  23. }
  24.  
Success #stdin #stdout 0.01s 5268KB
stdin
Standard input is empty
stdout
Thieu can