rahul question
#include <iostream>
using namespace std;
int main() {
double inputweight;cin>>inputweight;
int countryid;cin>>countryid;
if(countryid==101)
{
if(inputweight>=58 && inputweight<=65)
{
cout<<0<<" "<<"chicago";
}
else if(inputweight<58)
{
cout<<58-inputweight<<" "<<"chicago";
}
else
{
cout<<inputweight-65<<" "<<"chicago";
}
}
else if(countryid==102)
{
if(inputweight>=66 && inputweight<=72)
{
cout<<0<<" "<<"Vancouver";
}
else if(inputweight<66)
{
cout<<66-inputweight<<" "<<"Vancouver";
}
else
{
cout<<inputweight-72<<" "<<"Vancouver";
}
}
else if(countryid==103)
{
if(inputweight>=69 && inputweight<=75)
{
cout<<0<<" "<<"Cairo";
}
else if(inputweight<69)
{
cout<<69-inputweight<<" "<<"Cairo";
}
else
{
cout<<inputweight-75<<" "<<"Cairo";
}
}
else
{
if(inputweight>=59 && inputweight<=63)
{
cout<<0<<" "<<"Berlin";
}
else if(inputweight<59)
{
cout<<59-inputweight<<" "<<"Berlin";
}
else
{
cout<<inputweight-63<<" "<<"Berlin";
}
}
}
Comments
Post a Comment