#include <iostream>
using namespace std;
int main()
{
int age;
int height;
cout << "Enter age: \n";
cin >> age;
if (age < 10 || age > 100)
{
cout << "wrong age";
exit(0);
}
cout << "Enter height in centimeters: \n";
cin >> height;
if (height < 100 || height > 255)
{
cout << "wrong height";
exit(0);
}
cout << "Recommended weight is: " << (height - 100 + age % 10) * 0.9 << "kg\n";
}
Comments
Leave a comment