Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|
97212 | zzx99001 | 勾股数 | C++ | Accepted | 2 MS | 264 KB | 406 | 2024-11-10 21:55:50 |
#include<iostream> int main() { int count=0; for (int i=1;i<=100;i++){ for (int j=i+1;j<=100;j++){ if(i*i+j*j<=100*100){ for (int k=j+1;k<=100;k++){ if(i*i+j*j==k*k){ count++; std::cout<<i<<" "<<j<<" "<<k<<std::endl;} } } } } std::cout<<count<<std::endl; return 0; }