目录
一、初识整型int-%d、浮点型double-%f
1.英寸和米的转换
#include <stdio.h>
int main()
{
printf("height inch ");
double foot;
double inch;
scanf("%lf %lf", &foot, &inch);
printf("height%f\n ",
((foot + inch / 12) * 0.3048));
return 0;
}
2.输出比较(整数型的运算还是整数,带小数点至少是浮点数)
#include <stdio.h>
int main()
{
printf("10/3*3=%d\n", 10/3*3);
return 0;
}
<