'commit'
This commit is contained in:
10
C++专题课程/基础知识/保留小数点后两位.cpp
Normal file
10
C++专题课程/基础知识/保留小数点后两位.cpp
Normal file
@@ -0,0 +1,10 @@
|
||||
#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;
|
||||
}
|
||||
Reference in New Issue
Block a user