谁帮帮看看为什么while退不出循环?
#include <stdio.h>#define C_FEET 0.03281
#define F_INCHES 12
int main(void)
{
float feet,inches,cm;
printf("Enter a height in centimeters:\n");
scanf("%.1f",&cm);
while(cm>0)
{
feet=cm*C_FEET;
inches=(feet-(int)feet)*F_INCHES;
printf("%.1f cm=%d feet,%.1f inches\n",cm,(int)feet,inches);
printf("Enter a height in centimeters:\n");
scanf("%.1f",&cm);
}
printf("bye");
return 0;
}
在codeblocks中一直退不出循环
[ 本帖最后由 飞莲 于 2012-2-2 14:43 编辑 ]