You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

16 lines
390 B

fn main() {
let n = 1000;
for a in 1..n {
for b in a+1..n {
for c in b+1..n {
if a * a + b * b == c * c {
if a + b + c == 1000 {
println!("{}^2 + {}^2 = {}^2", a, b, c);
println!("a*b*c = {}", a * b * c);
}
}
}
}
}
}