September 2017 Update
This commit is contained in:
parent
bba7bfd280
commit
ba8067c3b7
14570 changed files with 153136 additions and 63871 deletions
7
Task/Catamorphism/Rust/catamorphism.rust
Normal file
7
Task/Catamorphism/Rust/catamorphism.rust
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
fn main() {
|
||||
println!("Sum: {}", (1..10).fold(0, |acc, n| acc + n));
|
||||
println!("Product: {}", (1..10).fold(1, |acc, n| acc * n));
|
||||
let chars = ['a', 'b', 'c', 'd', 'e'];
|
||||
println!("Concatenation: {}",
|
||||
chars.iter().map(|&c| (c as u8 + 1) as char).collect::<String>());
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue