玄关 30 分求解
查看原帖
玄关 30 分求解
1329166
54jiujiu1010楼主2024/10/11 19:26
#include<bits/stdc++.h>
using namespace std;
int main(){
	int n;
	cin >> n;
	for(int i = 1;i <= n;i++){
		int x,y,f = 0;
		cin >> x;
		for(int j = 1;j < x;j++){
			y = x - j * j;
			int s = sqrt(x);
			if(s * s == y) f = 1;
		}
		if(f) cout << "Yes" << "\n";
		else cout << "No" << "\n"; 
	}
	return 0;
}
2024/10/11 19:26
加载中...