本题要求编写程序,计算摄氏温度26°C 对应的华氏温度。计算公式:F=9×C/5+32,式中:C表示摄氏温度,F表示华氏温度,输出数据要求为整型。
输入格式:
本题目没有输入。
输出格式:
按照下列格式输出
celsius = 26, fahr = 对应的华氏温度整数值
#include <stdio.h>
#include <stdlib.h>
/* run this program using the console pauser or add your own getch, system("pause") or input loop */
int main(int argc, char *argv[]) {
double c=26;
int f=9*c/5+32;
printf("celsius = 26, fahr = %d",f);
return 0;
}