Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- int main()
- {
- // KOBIETY
- std::cout << "Podaj wiek";
- int wiek;
- std::cin >> wiek;
- if (wiek >= 30 || wiek <= 34)
- wiek = 0
- if (wiek >= 35 || wiek <= 39)
- wiek = 2
- if (wiek >= 40 || wiek <= 44)
- wiek = 4
- if (wiek >= 45 || wiek <= 49)
- wiek = 5
- if (wiek >= 50 || wiek <= 54)
- wiek = 7
- if (wiek >= 55 || wiek <= 59)
- wiek = 8
- if (wiek >= 60 || wiek <= 64)
- wiek = 9
- if (wiek >= 65 || wiek <= 69)
- wiek = 10
- if (wiek >= 70 || wiek <= 74)
- wiek = 11
- if (wiek >= 75)
- wiek = 12
- std::cout << "Podaj HDL";
- int HDL;
- std::cin >> HDL;
- if (HDL < 35)
- HDL = 2
- if (HDL >= 35 || HDL <= 44)
- HDL = 1
- if (HDL >= 45 || HDL <= 49)
- HDL = 0
- if (HDL >= 50 || HDL <= 59)
- HDL = -1
- if (HDL >= 60)
- HDL = -2
- std::cout << "Podaj Total Cholesterol";
- int TotalCholesterol;
- std::cin >> TotalCholesterol;
- if (TotalCholesterol < 160)
- TotalCholesterol = 0
- if (TotalCholesterol >= 160 || TotalCholesterol <= 199)
- TotalCholesterol = 1
- if (TotalCholesterol >= 200 || TotalCholesterol <= 239)
- TotalCholesterol = 3
- if (TotalCholesterol >= 240 || TotalCholesterol <= 279)
- TotalCholesterol = 4
- if (TotalCholesterol > 280)
- TotalCholesterol = 5
- std::cout << "Podaj SBP Not Treated";
- int SBPNotTreated;
- std::cin >> SBPNotTreated;
- if (SBPNotTreated < 120)
- SBPNotTreated = -3
- if (SBPNotTreated >= 120 || SBPNotTreated <= 129)
- SBPNotTreated = 0
- if (SBPNotTreated >= 130 || SBPNotTreated <= 139)
- SBPNotTreated = 1
- if (SBPNotTreated >= 140 || SBPNotTreated <= 149)
- SBPNotTreated = 2
- if (SBPNotTreated >= 150 || SBPNotTreated <= 159)
- SBPNotTreated = 4
- if (SBPNotTreated >= 160)
- SBPNotTreated = 5
- std::cout << "Podaj SBP Treated";
- int SBPTreated;
- std::cin >> SBPTreated;
- if (SBPTreated < 120)
- SBPTreated = -1
- if (SBPTreated >= 120 || SBPTreated <= 129)
- SBPTreated = 2
- if (SBPTreated >= 130 || SBPTreated <= 139)
- SBPTreated = 3
- if (SBPTreated >= 140 || SBPTreated <= 149)
- SBPTreated = 5
- if (SBPTreated >= 150 || SBPTreated <= 159)
- SBPTreated = 6
- if (SBPTreated >= 160)
- SBPTreated = 7
- std::cout << "Podaj Smoker";
- int Smoker;
- std::cin >> Smoker;
- if (Smoker = 0)
- Smoker = 0
- if (Smoker = 1)
- Smoker = 3
- std::cout << "Podaj Diabetic";
- int Diabetic;
- std::cin >> Diabetic;
- if (Diabetic = 0)
- Diabetic = 0
- if (Diabetic = 1)
- Diabetic = 4
- int wynik = wiek + HDL + TotalCholesterol + SBPNotTreated + SBPTreated + Smoker + Diabetic;
- std::cout << "Wynik: "<< wynik << std::endl;
- // MEZCZYZNI
- std::cout << "Podaj wiek";
- int wiek;
- std::cin >> wiek;
- if (wiek >= 30 || wiek <= 34)
- wiek = 0
- if (wiek >= 35 || wiek <= 39)
- wiek = 2
- if (wiek >= 40 || wiek <= 44)
- wiek = 5
- if (wiek >= 45 || wiek <= 49)
- wiek = 6
- if (wiek >= 50 || wiek <= 54)
- wiek = 8
- if (wiek >= 55 || wiek <= 59)
- wiek = 10
- if (wiek >= 60 || wiek <= 64)
- wiek = 11
- if (wiek >= 65 || wiek <= 69)
- wiek = 12
- if (wiek >= 70 || wiek <= 74)
- wiek = 14
- if (wiek >= 75)
- wiek = 15
- std::cout << "Podaj HDL";
- int HDL;
- std::cin >> HDL;
- if (HDL < 35)
- HDL = 2
- if (HDL >= 35 || HDL <= 44)
- HDL = 1
- if (HDL >= 45 || HDL <= 49)
- HDL = 0
- if (HDL >= 50 || HDL <= 59)
- HDL = -1
- if (HDL >= 60)
- HDL = -2
- std::cout << "Podaj Total Cholesterol";
- int TotalCholesterol;
- std::cin >> TotalCholesterol;
- if (TotalCholesterol < 160)
- TotalCholesterol = 0
- if (TotalCholesterol >= 160 || TotalCholesterol <= 199)
- TotalCholesterol = 1
- if (TotalCholesterol >= 200 || TotalCholesterol <= 239)
- TotalCholesterol = 2
- if (TotalCholesterol >= 240 || TotalCholesterol <= 279)
- TotalCholesterol = 3
- if (TotalCholesterol >= 280 || TotalCholesterol <= 159)
- TotalCholesterol = 4
- std::cout << "Podaj SBP Not Treated";
- int SBPNotTreated;
- std::cin >> SBPNotTreated;
- if (SBPNotTreated <= 120)
- SBPNotTreated = -2
- if (SBPNotTreated >= 120 || SBPNotTreated <= 129)
- SBPNotTreated = 0
- if (SBPNotTreated >= 130 || SBPNotTreated <= 139)
- SBPNotTreated = 1
- if (SBPNotTreated >= 140 || SBPNotTreated <= 159)
- SBPNotTreated = 2
- if (SBPNotTreated >160)
- SBPNotTreated = 3
- std::cout << "Podaj SBP Treated";
- int SBPTreated;
- std::cin >> SBPTreated;
- if (SBPTreated < 120)
- SBPTreated = 0
- if (SBPTreated >= 120 || SBPTreated <= 129)
- SBPTreated = 2
- if (SBPTreated >= 130 || SBPTreated <= 139)
- SBPTreated = 3
- if (SBPTreated >= 140 || SBPTreated <= 159)
- SBPTreated = 4
- if (SBPTreated >= 160)
- SBPTreated = 5
- std::cout << "Podaj Smoker";
- int Smoker;
- std::cin >> Smoker;
- if (Smoker = 0)
- Smoker = 0
- if (Smoker = 1)
- Smoker = 3
- std::cout << "Podaj Diabetic";
- int Diabetic;
- std::cin >> Diabetic;
- if (Diabetic = 0)
- Diabetic = 0
- if (Diabetic = 1)
- Diabetic = 4
- int wynik = wiek + HDL + TotalCholesterol + SBPNotTreated + SBPTreated + Smoker + Diabetic;
- std::cout << "Wynik: " << wynik << std::endl;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement