Main exercises

This commit is contained in:
Nidhal Messaoudi
2023-02-27 21:36:51 +01:00
parent 278a1f103b
commit 34aafa82f9
6 changed files with 52 additions and 23 deletions

View File

@@ -32,7 +32,7 @@ fn main() {
for offset in 0..8 {
let child_numbers = // TODO
joinhandles.push(thread::spawn(move || {
let sum: u32 = child_numbers.iter().filter(|n| *n % 8 == offset).sum();
let sum: u32 = child_numbers.iter().filter(|&&n| n % 8 == offset).sum();
println!("Sum of offset {} is {}", offset, sum);
}));
}