第4页-华氏温度与摄氏温度对照表

#include <cstdio>
/*
	C=(5/9)(F-32)打印华氏温度与摄氏温度对照表
*/
int main() {
	int fahr, celsius;
	int lower, upper, step;
	lower = 0;//温度表的下限
	upper = 300;//温度表的上限
	step = 20;//步长
	fahr = lower;
	while (fahr <= upper) {
		celsius = (fahr - 32) * 5 / 9;
		printf("%d\t%d\n", fahr, celsius);
		fahr = fahr + step;
	}
}

猜你喜欢

转载自blog.csdn.net/suifengTYZ/article/details/88234167