Files
python/C++专题课程/基础知识/保留小数点后两位.cpp
HuangHai 1f397eca87 'commit'
2025-08-30 18:35:01 +08:00

10 lines
322 B
C++

#include <iostream>
#include <cstdio>
using namespace std;
int main(){
float f,c; //定义华氏度、摄氏度
cin>>f; //输入华氏度
c=5*(f-32)/9; //计算
printf("c=%.2f",c); //输出,保留两位小数
return 0;
}