Advertisement
olaaa

Untitled

Oct 16th, 2019
122
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.92 KB | None | 0 0
  1. #include <iostream>
  2. #include <math.h>
  3.  
  4. using namespace std;
  5.  
  6.  
  7. int main()
  8. {
  9. float waga;//kg
  10. int wzrost;//cm
  11. float BMI;
  12.  
  13. cout << "Podaj swoja wage w kilogramach" << endl;
  14. cin >> waga;
  15. cout << "Podaj swoj wzrost w centrymetrach" << endl;
  16. cin >> wzrost;
  17.  
  18. BMI = (waga / (wzrost*wzrost)*10000);
  19.  
  20. cout << BMI << endl;
  21.  
  22. if (BMI < 16) {
  23. cout << "WYGLODZENIE" << endl;
  24. }
  25. if ((BMI >= 16) && (BMI <= 16.99)) {
  26. cout << "WYCHUDZENIE" << endl;
  27. }
  28. if ((BMI >= 17) && (BMI <= 18.49)) {
  29. cout << "NIEDOWAGA" << endl;
  30. }
  31. if ((BMI >= 18.5) && (BMI <= 24.99)) {
  32. cout << "WARTOSC PRAWIDLOWA" << endl;
  33. }
  34. if ((BMI >= 25) && (BMI <= 29.99)) {
  35. cout << "NADWAGA" << endl;
  36. }
  37. if ((BMI >= 30) && (BMI <= 34.99)) {
  38. cout << "I STOPIEN OTYLOSCI" << endl;
  39. }
  40. if ((BMI >= 35) && (BMI <= 39.99)) {
  41. cout << "II STOPIEN OTYLOSCI" << endl;
  42. }
  43. if (BMI >= 40) {
  44. cout << "OTYLOSC SKRAJNA" << endl;
  45. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement