newton/solutions/rust/200B.rs

18 lines
419 B
Rust
Raw Normal View History

2025-01-18 00:22:46 +00:00
use std::io;
fn main() {
let mut s = String::new();
io::stdin().read_line(&mut s).unwrap();
let n = s.trim().parse::<u64>().unwrap();
let mut p = String::new();
io::stdin().read_line(&mut p).unwrap();
let drinks = p.trim().split_whitespace().map(|c| c.parse::<u64>().unwrap()).collect::<Vec<u64>>();
let conc = drinks.iter().sum::<u64>() as f64 / n as f64;
println!("{}", conc);
}