C++的小数点后几位的四舍五入
cout.setf(ios::fixed); cout.setf(ios::showpoint); cout.precision(3); cout << maxvalue << endl;
等同于C语言的
printf( "%.3lf\n", maxvalue );
posted on 2010-06-23 15:00 AgPro 阅读(1535) 评论(1) 编辑 收藏 举报
Powered by: 博客园 Copyright © 2024 AgPro Powered by .NET 9.0 on Kubernetes