Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <cmath>
- #include <vector>
- #include <windows.h>
- #include <cstdlib>
- using namespace std;
- int main()
- {
- vector <float> BMI;
- int numberOfSurveyedPeople;
- cin >> numberOfSurveyedPeople;
- for (int i = 0; i < numberOfSurveyedPeople; i++){
- //string nameOfTheSurveyedPerson;
- int bodyWeightKilogram = 0;
- int heightCentimeters = 0;
- cin /*>> nameOfTheSurveyedPerson */>> bodyWeightKilogram >> heightCentimeters;
- float heightMeters = (heightCentimeters / 100);
- float squaredValueOfTheHeight = pow(heightCentimeters,2);
- float bmiValue = (bodyWeightKilogram / squaredValueOfTheHeight);
- cout << bmiValue;
- BMI.push_back(bmiValue);
- }
- /*for(float j = 0; j < BMI.size(); j++){
- if(BMI[j] >= 25)
- cout << "nadwaga" << endl; // nameOfTheSurveyedPerson;
- else if(BMI[j] > 18.5 && BMI[j] < 25)
- cout << "wartosc prawidlowa";
- else(BMI[j] <= 18.5);
- cout << "niedowaga";*/
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement