#include <cmath> #include <iostream> using namespace std; int main() { int a; cin>> a; cout<<floor(sqrt((double)a))<<endl; }
| 函数 | 功能 | 示例 |
| ------------- | ------------ | ---------------------- |
floor(x) | 向下取整(向负无穷方向) | floor(3.7) → `3.0` |
ceil(x) | 向上取整(向正无穷方向) | ceil(3.2) → `4.0` |
round(x) | 四舍五入 | round(3.5) → `4.0` |
trunc(x) | 截断小数(向零方向) | trunc(-2.9) → `-2.0` |