题解 | #温度转换#
温度转换
https://www.nowcoder.com/practice/ba83647087b7447783fa2384da6b3d44
#include <stdio.h> int main() { float f = 0.0; scanf("%f", &f); float c = 0.0; // 两个整数相除,如有小数则商向下取整: // 如5 / 9 = 0.5,因为5和9属于整型常量,0.5会向下取整得到0 c = (5 / 9.0) * (f - 32); printf("%.3f", c); return 0; }