1995 保留3位小数的浮点数

#include <iostream>
#include<iomanip>     //浮点数需要用到的头文件 
using namespace std;

int main() {
	//输入一个浮点数 
	double b; 
	cin>>b;
	
	//保留3位小数	
	cout<<fixed<<setprecision(3)<<b; 
	 

	return 0;
}
posted @ 2024-10-23 15:40  行胜于言Ibl  阅读(34)  评论(0)    收藏  举报