#include <bits/stdc++.h>
using namespace std;
bool a_test(int x) {
// 如果大数,int->long long
if (sqrt(x) == (int)sqrt(x)) {
return true;
} else {
return false;
}
}
int main() {
cout << a_test(10) << endl; // 0
cout << a_test(9) << endl; // 1
return 0;
}
标签:判断,return,int,long,整数,sqrt,平方根
From: https://www.cnblogs.com/xiufanivan/p/17409559.html