iof 0.5.0

Read from and write data to console or file in simple formats.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
use iof::{read, read_n};

/// Reads `n` integers `a`, `b` and `c` from input and checks if the dot product of `a` and `b` is equal to `c`.
fn main() {
    let n: usize = read();
    let a: Vec<i32> = read_n(n);
    let b: Vec<i32> = read_n(n);
    let c: Vec<i32> = read_n(n);
    for i in 0..n {
        assert_eq!(a[i] * b[i], c[i]);
    }
}