AC 枚举遍历
查看原帖
AC 枚举遍历
776958
CodingSu楼主2024/10/29 15:20
#include<bits/stdc++.h>
using namespace std;

int t;

int main(){
    cin >> t;
    for(int i = 1; i < t; i++){
        for(int j = 1; j < t; j++){
            if(i * i + j * j == t * t) {
                cout << i << " " << j << endl;
                return 0;
            }
        }   
    }
    return 0;
}
2024/10/29 15:20
加载中...