Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- const int calewstopach = 12;
- const float zmMetr = 0.0254;
- const float funty = 2.2;
- int stopki(int, int);
- float metry(int);
- float kilog(int);
- int main()
- {
- int stopy, cale;
- float waga;
- std::cout<<"Podaj wzrost w stopach i calach. Ilosc stop: \n";
- std::cin>>stopy;
- std::cout<<"Ilosc cali: \n";
- std::cin>>cale;
- std::cout<<"Podaj wage w funtach: \n";
- std::cin>>waga;
- std::cout<<"Twoje BMI wynosi: ";
- float caleca = stopki(stopy, cale);
- long double bmi = kilog(waga)/(metry(caleca)*metry(caleca));
- std::cout<<bmi;
- return 0;
- }
- int stopki(int n, int m)
- {
- return n*calewstopach + m;
- }
- float metry(int n)
- {
- return n*zmMetr;
- }
- float kilog(int n)
- {
- return n/funty;
- }
Advertisement
Add Comment
Please, Sign In to add comment