温度转换


#include
main()
{
	int fahr, celsius;
	int lower, upper, step;
	lower = 0;
	upper = 300;
	step = 20;
	celsius = lower;
	printf("C\tF\n");
	while(celsius <= upper){
		fahr = celsius * 9 / 5 +32;
		printf("%d\t%d\n",celsius,fahr);
		celsius += step;
	}
}

发表回复

您的电子邮箱地址不会被公开。 必填项已用*标注