📌  相关文章
📜  将数字四舍五入到小数点后两位 C++ 代码示例

📅  最后修改于: 2022-03-11 14:44:50.135000             🧑  作者: Mango

代码示例3
float a,b,c,d,sum;

 cin>>a>>b>>c>>d; // reading decimal values

sum=(a*b*c*d);

sum=round(sum*100)/100; // here it is for 2 decimal points

if((float)sum < (float) 9.58)
  cout<<"YES\n";
else
  cout<<"NO\n";