赞
踩
-
- #include<cmath>
- #include <iostream>
- using namespace std;
- int main(){
-
- cout<<ceil(3.5)<<" "<<ceil(-3.5)<<endl;//向下取整
- cout<<floor(3.5)<<" "<<floor(-3.5)<<endl;//向上取整
- cout<<int(3.5)<<" "<<int(-3.5)<<endl;//int取整
- cout<<sqrt(2)<<" "<<sqrt(9)<<endl;//开方
- cout<<pow(2,10)<<endl;//乘方
- cout<<round(3.5)<<" "<<round(3.49)<<endl;//四舍五入
- cout<<log(2.71828)<<endl;//log 对数
- cout<<log(10)/log(2)<<endl;//log 换底公式
-
- return 0;
- }
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。