SHARE
TWEET

Untitled

a guest Oct 23rd, 2019 68 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <iostream>
  2. #include <cmath>
  3. #include <vector>
  4. #include <windows.h>
  5. #include <cstdlib>
  6.  
  7. using namespace std;
  8.  
  9. int main()
  10. {
  11.     vector <float> BMI;
  12.     int numberOfSurveyedPeople;
  13.     cin >> numberOfSurveyedPeople;
  14.     for (int i = 0; i < numberOfSurveyedPeople; i++){
  15.  
  16.         //string nameOfTheSurveyedPerson;
  17.         int bodyWeightKilogram = 0;
  18.         int heightCentimeters = 0;
  19.         cin /*>> nameOfTheSurveyedPerson */>> bodyWeightKilogram >> heightCentimeters;
  20.         float heightMeters = (heightCentimeters / 100);
  21.         float squaredValueOfTheHeight = pow(heightCentimeters,2);
  22.         float bmiValue = (bodyWeightKilogram / squaredValueOfTheHeight);
  23.         cout << bmiValue;
  24.         BMI.push_back(bmiValue);
  25.     }
  26.     /*for(float j = 0; j < BMI.size(); j++){
  27.         if(BMI[j] >= 25)
  28.             cout << "nadwaga" << endl;  // nameOfTheSurveyedPerson;
  29.         else if(BMI[j] > 18.5 && BMI[j] < 25)
  30.             cout << "wartosc prawidlowa";
  31.         else(BMI[j] <= 18.5);
  32.             cout << "niedowaga";*/
  33.     return 0;
  34. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top