You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
|
|
#include <bits/stdc++.h>
|
|
|
|
|
using namespace std;
|
|
|
|
|
int main() {
|
|
|
|
|
int n = 10;
|
|
|
|
|
cout << (int)pow(n, 1.0 / 2) << endl;
|
|
|
|
|
// 输出3,理解一下:
|
|
|
|
|
// 10以内,可以描述为x^2的有:1^2 2^2 3^2
|
|
|
|
|
// 这样,就是说上面的算法,把数字1记录在内了。
|
|
|
|
|
return 0;
|
|
|
|
|
}
|