2 条题解
#include<bits/stdc++.h> using namespace std; int main(){ double f; while(cin>>f){ double c = (f-32)*5/9; // 华氏→摄氏 cout<<fixed<<setprecision(2)<<c<<endl; } return 0; }
#include<bits/stdc++.h> using namespace std; int main(){ int c; double f; cin>>c;//输入摄氏温度 //9/5是小数所以华氏温度要用小数,要把9*1.0变成小数 f=9*1.0/5*c*1.0+32;//计算华氏温度 cout<<fixed<<setprecision(2)<<f; return 0; }
使用您的 Hydro 通用账户