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.
26 lines
469 B
26 lines
469 B
use std::fs::File; |
|
use std::io::{ self, BufRead, BufReader }; |
|
|
|
const PS_SIZE: usize = 500usize; |
|
|
|
|
|
fn divs_num(n: u32) -> u32 { |
|
let mut res = 0; |
|
for i in 1..n { |
|
if n % i == 0 { res += 1; } |
|
} |
|
return res; |
|
} |
|
|
|
fn main() { |
|
let mut n = 1; |
|
let mut best_dn = 1; |
|
for k in 2..50000 { |
|
n += k; |
|
let dn = divs_num(n); |
|
if dn > best_dn { |
|
best_dn = dn; |
|
println!("[{}]{}:{}",k, n, dn); |
|
} |
|
} |
|
}
|
|
|