(1) (判断平方数) 问题:给定一个正整数 n,判断这个数 是不是完全平方数,即存在一个正整数 x 使得 x 的平方等于 n。试补全程序。
#include
#include
using namespace std;
bool isSquare(int num){
int i = ___(1)___;
int bound =___(2)___;
for(;i<=bound;++i){
if(___(3)___){
return ___(4)___;
}
}
return ___(5)___;
}
int main(){
int n;
cin>>n;
if(isSquare(n)){
cout<< n<< " is a Square number"<< endl;
}else{
cout<< n<< " is not a Square number"<< endl;
}
}