Skip to content

Instantly share code, notes, and snippets.

@metamemelord
Created June 20, 2020 15:39
Show Gist options
  • Save metamemelord/135b9aba87a6bbe165e756e34218e3f2 to your computer and use it in GitHub Desktop.
Save metamemelord/135b9aba87a6bbe165e756e34218e3f2 to your computer and use it in GitHub Desktop.
use std::io::stdin;
macro_rules! read {
($v: ident : $t: ty) => {
let mut buf = String::new();
let _ = stdin().read_line(&mut buf).unwrap();
let mut $v = buf.trim().trim_end().parse::<$t>().unwrap();
};
}
fn main() {
read!(n: i32);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment