#include
int main()
{
int cm,foot,inch;
double meter;
scanf("%d",&cm);
meter=cm/100.0;
inch=12*meter/0.3048/145;
foot=inch/12;
inch=inch%12;
printf("%d %d",foot,inch);
return 0;
}
这样写吧,编辑器把你的double当成强制转换来看了
#include
int main()
{
int cm,foot,inch;
double meter;
scanf("%d",&cm);
meter=cm/100.0;
inch=12*meter/0.3048/145;
foot=inch/12;
inch=inch%12;
printf("%d %d",foot,inch);
return 0;
}
这样写吧,编辑器把你的double当成强制转换来看了