40分求助!!!
查看原帖
40分求助!!!
1368233
liyifanglan楼主2024/7/21 15:29
#include<bits/stdc++.h>
using namespace std;

int main(){
	int t;
	cin >> t;
	while (t--){
		int a;
		bool x = 0;
		cin >> a;
		for (int i = 0; i <= a; i++){
			int j = sqrt(a-i*i);
			if (j*j + i*i == a){
				x = 1;
				break;
			}
		}
		if (x == 1){
			cout << "Yes" << endl;
		}else{
			cout << "No" << endl;
		}
	}
}
2024/7/21 15:29
加载中...