readput
Fast and easy stdin input parsing for competitive programming in rust.
Usage
Note: The inputs can be on the same line, or not, it doesn't make a difference. They are separated by spaces or line breaks. Excess inputs are getting cached for the next read() call.
Create a Scanner
Create a new Scanner. (Only ASCII support for now)
use AsciiScanner;
use Scanner;
let mut cin = new;
Read a single value
Note: They have to impl. FromStr and Debug.
let v = read!;
Read a tuple
let = read!;
let = read!;
Read a vector of tuples
Read a vector of tuples. 3 is the number of tuples in the vector to read.
let vec = read_vec!;
Read a vector of single values
Read a vector of single values. 3 is the number of elements to read. Note: They also have to impl. FromStr and Debug.
let vec: = read_vec!;
Iterate over input
Iterate over input. This will iterate forever. (Blocks until new input is entered).
for in iter!