L1-004 计算摄氏温度

it2022-05-05  148

L1-004 计算摄氏温度 (5 分)

给定一个华氏温度F,本题要求编写程序,计算对应的摄氏温度C。计算公式:C=5×(F32)/9。题目保证输入与输出均在整型范围内。

输入格式:

输入在一行中给出一个华氏温度。

输出格式:

在一行中按照格式“Celsius = C”输出对应的摄氏温度C的整数值。

输入样例:

150

输出样例:

Celsius = 65 1 #include<iostream> 2 3 using namespace std; 4 5 int main(){ 6 int degree = 0; 7 cin>>degree; 8 int celsius = 5 * (degree - 32) / 9; 9 cout <<"Celsius = "<<celsius; 10 return 0; 11 }

 


转载于:https://www.cnblogs.com/Frances-CY-FKYM/p/10293427.html

相关资源:各显卡算力对照表!

最新回复(0)