solutions: 9

This commit is contained in:
Muhammad Nauman Raza 2024-11-20 11:58:40 +00:00
parent bcfc1bd6d0
commit 49a87c045c
Signed by: devraza
GPG key ID: 91EAD6081011574B

View file

@ -0,0 +1,17 @@
fn main() {
'algorithm: loop {
for i in 1..1000 {
for j in 1..1000 {
for k in 1..1000 {
let pythagoras: f64 = (i as f64).powf(2.) + (j as f64).powf(2.);
if pythagoras == (k as f64).powf(2.) {
if i+j+k == 1000 {
println!("{}", i*j*k);
break 'algorithm;
}
}
}
}
}
}
}