Guest User

kod do zadania

a guest
Apr 26th, 2016
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.76 KB | None | 0 0
  1. #include <iostream>
  2. const int calewstopach = 12;
  3. const float zmMetr = 0.0254;
  4. const float funty = 2.2;
  5. int stopki(int, int);
  6. float metry(int);
  7. float kilog(int);
  8. int main()
  9. {
  10. int stopy, cale;
  11. float waga;
  12. std::cout<<"Podaj wzrost w stopach i calach. Ilosc stop: \n";
  13. std::cin>>stopy;
  14. std::cout<<"Ilosc cali: \n";
  15. std::cin>>cale;
  16. std::cout<<"Podaj wage w funtach: \n";
  17. std::cin>>waga;
  18. std::cout<<"Twoje BMI wynosi: ";
  19. float caleca = stopki(stopy, cale);
  20. long double bmi = kilog(waga)/(metry(caleca)*metry(caleca));
  21. std::cout<<bmi;
  22.  
  23. return 0;
  24. }
  25. int stopki(int n, int m)
  26. {
  27. return n*calewstopach + m;
  28. }
  29. float metry(int n)
  30. {
  31. return n*zmMetr;
  32. }
  33. float kilog(int n)
  34. {
  35. return n/funty;
  36. }
Advertisement
Add Comment
Please, Sign In to add comment