let arr = [10, 20, 30, 40];
let sum: i32 = arr.iter().sum();
println!("جمع عناصر آرایه: {}", sum);