Cullen and Woodall numbers: Difference between revisions
Content deleted Content added
m Rust - fixed output |
m Rust - replace to_string_radix by to_string |
||
Line 651: | Line 651: | ||
fn main() { |
fn main() { |
||
println!("First 20 Cullen numbers:"); |
println!("First 20 Cullen numbers:"); |
||
let cullen: Vec<String> = (1..21) |
let cullen: Vec<String> = (1..21).map(|x| cullen_number(x).to_string()).collect(); |
||
.map(|x| cullen_number(x).to_string_radix(10)) |
|||
.collect(); |
|||
println!("{}", cullen.join(" ")); |
println!("{}", cullen.join(" ")); |
||
println!("\nFirst 20 Woodall numbers:"); |
println!("\nFirst 20 Woodall numbers:"); |
||
let woodall: Vec<String> = (1..21) |
let woodall: Vec<String> = (1..21).map(|x| woodall_number(x).to_string()).collect(); |
||
.map(|x| woodall_number(x).to_string_radix(10)) |
|||
.collect(); |
|||
println!("{}", woodall.join(" ")); |
println!("{}", woodall.join(" ")); |
||