#include <iostream> using namespace std; bool power(int x){ for(int i=1;i*i<=x;i++)if(i*i==x)return true; return false; } int main(){ int n=0; while(true){ if(power(n+100)&&power(n+268)){ cout<<n<<endl; return 0; } n++; } return 0; }
直接看样例()
#include<bits/stdc++.h> using namespace std; int main() { cout<<21; return 0; }
#include <bits/stdc++.h> using namespace std; int main() { cout << 21; return 0; }
试出的正确答案。
注册一个 核OJ_核桃编程 通用账户,您就可以在我们提供的所有在线评测服务上提交代码、参与讨论。
使用您的 核OJ_核桃编程 通用账户