#include <iostream>
using namespace std;
int main()
{
//向上取整
float x = 4.6;
int n = ceil(x);
cout << n << endl;
//向下取整
cout << floor(x)<<endl;
}
© 版权声明
THE END
#include <iostream>
using namespace std;
int main()
{
//向上取整
float x = 4.6;
int n = ceil(x);
cout << n << endl;
//向下取整
cout << floor(x)<<endl;
}
微信扫码进入云港网络用户群
您可以在用户群跟群友交流哦~
暂无评论内容