#include <iostream> #include <cmath>//头文件 using namespace std; int main () { double n; cin>>n; cout<<ceil(n)<<endl;//天花板:向上取整 cout<<round(n)<<endl;//周围:四舍五入 cout<<floor(n)<<endl;//地板:向下取整 return 0; }
cmath取整函数
猜你喜欢
转载自www.cnblogs.com/zwx7616/p/10734459.html
今日推荐
周排行