#include
using namespace std;
int main()
{ float c,f;
cout<<"请输入一个华氏度";
cin>>f;
c=(5.0/9.0)*(f-32);
cout<<"摄氏度为:" <<setiosflags(ios::fixed)<<setprecision(2)<<c<<endl;
return 0;
}
#include
using namespace std;
int main()
{ float c,f;
cout<<"请输入一个华氏度";
cin>>f;
c=(5.0/9.0)*(f-32);
cout<<"摄氏度为:" <<setiosflags(ios::fixed)<<setprecision(2)<<c<<endl;
return 0;
}
你没加对应的头文件iomanip
#include <iostream>
#include <iomanip>
using namespace std;
int main()
{ float c,f;
cout<<"请输入一个华氏度";
cin>>f;
c=(5.0/9.0)*(f-32);
cout<<"摄氏度为:" <<setiosflags(ios::fixed)<<setprecision(2)<<c<<endl;
return 0;
}