double 函数

10/3

13/5=2.6

10%3=1

在C++怎么四舍五入

#include<iostream>
#include  <cmath>
using namesapce std;
int main (){
     double i=round(13.0/5);
     cout<<i<<endl;
     return 0;

}

 

posted @ 2024-04-13 08:36  郭立恒  阅读(11)  评论(0)    收藏  举报