练习1.4

来源:互联网 发布:python账号注册登录 编辑:程序博客网 时间:2024/05/14 17:49

将华氏温度转换成摄氏温度

 

 

直接代码:

 

#include <stdio.h>void temperatureConvert(double b, double e);int main(int argc, char *argv[]){    temperatureConvert(-10.0, 20.0);    return 0;}void temperatureConvert(double b, double e){    for (double cent = b; cent <= e; cent += 2.5) {        double fahr = (9.0/5.0)*cent+32.0;        printf("%-10.3f:%.3f\n", cent, fahr);    }}


 

原创粉丝点击