69,373
社区成员
发帖
与我相关
我的任务
分享
#include <stdio.h>
int main(void)
{
void temperatures(double Fahrenheit);
double fahrenheit; //华氏温度
printf("请输入温度:\n");
scanf("%f",&fahrenheit); /*疑问1*/
//printf("%.2f\n",fahrenheit);
temperatures(fahrenheit);
return 0;
}
void temperatures(double fahrenheit) /*疑问2*/
{
double celsius,kelvin;
//printf("%.2f\n",fahrenheit);
celsius = 1.8 * fahrenheit + 32.0; //华氏转摄氏
kelvin = celsius + 273.16; //华氏转绝对
printf("%.2f,%.2f\n",celsius,kelvin);
}