//这个题主要是只要满12inch就转换为1个foot,只要明白这点就简单了。这个题如果直接舍入可能不过,也就是直接强制类型转化不行。
#include <stdio.h>
int main()
{
int i,foot,inch,d;
scanf("%d",&i);
float g1,n1=i/30.48,j;
g1=n1*12.0; //g1是精确的inch总数;
foot=g1/12;
j=g1-foot*12.0; //剩余inch总数;
if(j/12.0*0.3048<=i/100.0-foot*0.3048)
{
inch=(int )j;
}
else
{
if(j-(int)j>=0.5)/*进行四舍五入的判断*/
{
d=(int)j;
d++;
inch=d-1;
}
else
{
d=(int)j;
inch=d;
}
}
printf("%d %d",foot,inch);
return 0;
}