题解 | 平方根
平方根
https://www.nowcoder.com/practice/cd21e09482f24b03842f02ae3d403cad
题干解读;要求输出其输入的数据a的算术平方根向下取整的值
思路:使用cmath库中的sqrt函数先求出其算数平方根,再对其进行强转,使其向下取整.
#include <iostream>
#include<cmath>
using namespace std;
int main() {
int a;
cin>>a;
cout<<(int)sqrt(a);
}
