Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
136237 张智博 勾股数 C++ Accepted 1 MS 264 KB 439 2025-11-09 22:21:13

Tests(1/1):


Code:

#include <bits/stdc++.h> using namespace std; int main() { int s=0; for (int a=1;a<100;++a) { for (int b=a+1;b<100;++b) { int c = (int)sqrt(a * a + b * b + 0.5); if (c * c == a * a + b * b && c <= 100) { cout << a << ' ' << b << ' ' << c << '\n'; ++s; } } } cout << s << '\n'; return 0; }