Advertisement
Guest User

Untitled

a guest
Jul 21st, 2018
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.26 KB | None | 0 0
  1. #include <iostream>
  2. int main()
  3. {
  4. // KOBIETY
  5.  
  6. std::cout << "Podaj wiek";
  7. int wiek;
  8. std::cin >> wiek;
  9. if (wiek >= 30 || wiek <= 34)
  10. wiek = 0
  11. if (wiek >= 35 || wiek <= 39)
  12. wiek = 2
  13. if (wiek >= 40 || wiek <= 44)
  14. wiek = 4
  15. if (wiek >= 45 || wiek <= 49)
  16. wiek = 5
  17. if (wiek >= 50 || wiek <= 54)
  18. wiek = 7
  19. if (wiek >= 55 || wiek <= 59)
  20. wiek = 8
  21. if (wiek >= 60 || wiek <= 64)
  22. wiek = 9
  23. if (wiek >= 65 || wiek <= 69)
  24. wiek = 10
  25. if (wiek >= 70 || wiek <= 74)
  26. wiek = 11
  27. if (wiek >= 75)
  28. wiek = 12
  29.  
  30. std::cout << "Podaj HDL";
  31. int HDL;
  32. std::cin >> HDL;
  33. if (HDL < 35)
  34. HDL = 2
  35. if (HDL >= 35 || HDL <= 44)
  36. HDL = 1
  37. if (HDL >= 45 || HDL <= 49)
  38. HDL = 0
  39. if (HDL >= 50 || HDL <= 59)
  40. HDL = -1
  41. if (HDL >= 60)
  42. HDL = -2
  43.  
  44. std::cout << "Podaj Total Cholesterol";
  45. int TotalCholesterol;
  46. std::cin >> TotalCholesterol;
  47. if (TotalCholesterol < 160)
  48. TotalCholesterol = 0
  49. if (TotalCholesterol >= 160 || TotalCholesterol <= 199)
  50. TotalCholesterol = 1
  51. if (TotalCholesterol >= 200 || TotalCholesterol <= 239)
  52. TotalCholesterol = 3
  53. if (TotalCholesterol >= 240 || TotalCholesterol <= 279)
  54. TotalCholesterol = 4
  55. if (TotalCholesterol > 280)
  56. TotalCholesterol = 5
  57.  
  58. std::cout << "Podaj SBP Not Treated";
  59. int SBPNotTreated;
  60. std::cin >> SBPNotTreated;
  61. if (SBPNotTreated < 120)
  62. SBPNotTreated = -3
  63. if (SBPNotTreated >= 120 || SBPNotTreated <= 129)
  64. SBPNotTreated = 0
  65. if (SBPNotTreated >= 130 || SBPNotTreated <= 139)
  66. SBPNotTreated = 1
  67. if (SBPNotTreated >= 140 || SBPNotTreated <= 149)
  68. SBPNotTreated = 2
  69. if (SBPNotTreated >= 150 || SBPNotTreated <= 159)
  70. SBPNotTreated = 4
  71. if (SBPNotTreated >= 160)
  72. SBPNotTreated = 5
  73.  
  74. std::cout << "Podaj SBP Treated";
  75. int SBPTreated;
  76. std::cin >> SBPTreated;
  77. if (SBPTreated < 120)
  78. SBPTreated = -1
  79. if (SBPTreated >= 120 || SBPTreated <= 129)
  80. SBPTreated = 2
  81. if (SBPTreated >= 130 || SBPTreated <= 139)
  82. SBPTreated = 3
  83. if (SBPTreated >= 140 || SBPTreated <= 149)
  84. SBPTreated = 5
  85. if (SBPTreated >= 150 || SBPTreated <= 159)
  86. SBPTreated = 6
  87. if (SBPTreated >= 160)
  88. SBPTreated = 7
  89.  
  90. std::cout << "Podaj Smoker";
  91. int Smoker;
  92. std::cin >> Smoker;
  93. if (Smoker = 0)
  94. Smoker = 0
  95. if (Smoker = 1)
  96. Smoker = 3
  97.  
  98. std::cout << "Podaj Diabetic";
  99. int Diabetic;
  100. std::cin >> Diabetic;
  101. if (Diabetic = 0)
  102. Diabetic = 0
  103. if (Diabetic = 1)
  104. Diabetic = 4
  105.  
  106. int wynik = wiek + HDL + TotalCholesterol + SBPNotTreated + SBPTreated + Smoker + Diabetic;
  107. std::cout << "Wynik: "<< wynik << std::endl;
  108.  
  109.  
  110.  
  111. // MEZCZYZNI
  112.  
  113. std::cout << "Podaj wiek";
  114. int wiek;
  115. std::cin >> wiek;
  116. if (wiek >= 30 || wiek <= 34)
  117. wiek = 0
  118. if (wiek >= 35 || wiek <= 39)
  119. wiek = 2
  120. if (wiek >= 40 || wiek <= 44)
  121. wiek = 5
  122. if (wiek >= 45 || wiek <= 49)
  123. wiek = 6
  124. if (wiek >= 50 || wiek <= 54)
  125. wiek = 8
  126. if (wiek >= 55 || wiek <= 59)
  127. wiek = 10
  128. if (wiek >= 60 || wiek <= 64)
  129. wiek = 11
  130. if (wiek >= 65 || wiek <= 69)
  131. wiek = 12
  132. if (wiek >= 70 || wiek <= 74)
  133. wiek = 14
  134. if (wiek >= 75)
  135. wiek = 15
  136.  
  137. std::cout << "Podaj HDL";
  138. int HDL;
  139. std::cin >> HDL;
  140. if (HDL < 35)
  141. HDL = 2
  142. if (HDL >= 35 || HDL <= 44)
  143. HDL = 1
  144. if (HDL >= 45 || HDL <= 49)
  145. HDL = 0
  146. if (HDL >= 50 || HDL <= 59)
  147. HDL = -1
  148. if (HDL >= 60)
  149. HDL = -2
  150.  
  151. std::cout << "Podaj Total Cholesterol";
  152. int TotalCholesterol;
  153. std::cin >> TotalCholesterol;
  154. if (TotalCholesterol < 160)
  155. TotalCholesterol = 0
  156. if (TotalCholesterol >= 160 || TotalCholesterol <= 199)
  157. TotalCholesterol = 1
  158. if (TotalCholesterol >= 200 || TotalCholesterol <= 239)
  159. TotalCholesterol = 2
  160. if (TotalCholesterol >= 240 || TotalCholesterol <= 279)
  161. TotalCholesterol = 3
  162. if (TotalCholesterol >= 280 || TotalCholesterol <= 159)
  163. TotalCholesterol = 4
  164.  
  165. std::cout << "Podaj SBP Not Treated";
  166. int SBPNotTreated;
  167. std::cin >> SBPNotTreated;
  168. if (SBPNotTreated <= 120)
  169. SBPNotTreated = -2
  170. if (SBPNotTreated >= 120 || SBPNotTreated <= 129)
  171. SBPNotTreated = 0
  172. if (SBPNotTreated >= 130 || SBPNotTreated <= 139)
  173. SBPNotTreated = 1
  174. if (SBPNotTreated >= 140 || SBPNotTreated <= 159)
  175. SBPNotTreated = 2
  176. if (SBPNotTreated >160)
  177. SBPNotTreated = 3
  178.  
  179. std::cout << "Podaj SBP Treated";
  180. int SBPTreated;
  181. std::cin >> SBPTreated;
  182. if (SBPTreated < 120)
  183. SBPTreated = 0
  184. if (SBPTreated >= 120 || SBPTreated <= 129)
  185. SBPTreated = 2
  186. if (SBPTreated >= 130 || SBPTreated <= 139)
  187. SBPTreated = 3
  188. if (SBPTreated >= 140 || SBPTreated <= 159)
  189. SBPTreated = 4
  190. if (SBPTreated >= 160)
  191. SBPTreated = 5
  192.  
  193. std::cout << "Podaj Smoker";
  194. int Smoker;
  195. std::cin >> Smoker;
  196. if (Smoker = 0)
  197. Smoker = 0
  198. if (Smoker = 1)
  199. Smoker = 3
  200.  
  201. std::cout << "Podaj Diabetic";
  202. int Diabetic;
  203. std::cin >> Diabetic;
  204. if (Diabetic = 0)
  205. Diabetic = 0
  206. if (Diabetic = 1)
  207. Diabetic = 4
  208.  
  209. int wynik = wiek + HDL + TotalCholesterol + SBPNotTreated + SBPTreated + Smoker + Diabetic;
  210. std::cout << "Wynik: " << wynik << std::endl;
  211.  
  212. return 0;
  213. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement