提交时间:2024-05-18 14:31:28

运行 ID: 147291

#include <iostream> #include <cmath> using namespace std; bool isPerfectSquare(int x){ int s = sqrt(x); return s*s == x; } int main(){ int x; while(cin >> x){ if(isPerfectSquare(x)){ cout << 1 << endl; }else{ cout << 0 << endl; } } return 0; }