6 条题解
- 1
信息
- ID
- 65
- 时间
- 1000ms
- 内存
- 128MiB
- 难度
- 4
- 标签
- 递交数
- 615
- 已通过
- 295
- 上传者
Python的哦~
for a in range(3,21):
for b in range(4,21):
for c in range(5,21):
if a**2+b**2==c**2 and a<=b:
print(a,b,c)
么么哒
#include <iostream>
using namespace std;
int main()
{
int a,b,c;
for(a=1;a<=20;a++)for(b=20;b>=a;b--)for(c=20;c>=b;c--){
if(a*a+b*b==c*c){
cout<<a<<" "<<b<<" "<<c<<endl;
}
}
return 0;
}
c++
print('3'+" "+'4'+" "+"5")
print('5'+" "+'12'+" "+"13")
print('6'+" "+'8'+" "+"10")
print('8'+" "+'15'+" "+"17")
print('9'+" "+'12'+" "+"15")
print('12'+" "+'16'+" "+"20")
#include
using namespace std;
int main() { cout<<3<<" "<<4<<" "<<5<<endl;
cout<<5<<" "<<12<<" "<<13<<endl;
cout<<6<<" "<<8<<" "<<10<<endl;
cout<<8<<" "<<15<<" "<<17<<endl;
cout<<9<<" "<<12<<" "<<15<<endl;
cout<<12<<" "<<16<<" "<<20<<endl;
return 0; }
#include <bits/stdc++.h>
using namespace std;
int A,B,C;
int main ()
{
for(int a=1;a<=20;a++){
A=pow(a,2);
for(int c=3;c<=20;c++){
C=pow(c,2);
for(int b=a;b<=20;b++){
B=pow(b,2);
if(C==A+B && a<=b && b<=c ){
cout<<a<<" "<<b<<" "<<c<<endl;
}
}
}
}
return 0;
}