template_cp 0.1.3

This crate contains some utilities for easier and faster access to input and output
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
use template_cp::Scanner;
// use template_cp::{file_reader, file_writer};
use std::io;

fn main() {
    let mut scan = Scanner::new(io::stdin().lock());
    let mut out = io::BufWriter::new(io::stdout().lock()); 
    // let mut scan = file_reader("in.txt").unwrap();
    // let mut out = file_writer("out.txt").unwrap();
    solve(&mut scan, &mut out); 
}

fn solve<R: io::BufRead, W: io::Write>(scan: &mut Scanner<R>, out: &mut W) {
    let n: usize = scan.tok();
    writeln!(out, "{}", n).ok();
    let _v: Vec<i32> = (0..n).map(|_| scan.tok()).collect();
}