1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38

pub fn flush() {
  use std::io::Write;
  std::io::stdout().flush().unwrap();
}

pub fn flushln() {
  println!();
}

#[macro_export]
macro_rules! printfl {
  () => {{
    $crate::flush();
  }};
  ($($arg:tt)*) => {{
    print!($($arg)*);
    $crate::flush();
  }};
}

pub fn get_line() -> String {
  let mut s = String::new();
  std::io::stdin().read_line(&mut s).unwrap();
  s.trim().to_string()
}


#[macro_export]
macro_rules! msg_line {
  () => {{
    $crate::get_line()
  }};
  ($($arg:tt)*) => {{
    $crate::printfl!($($arg)*);
    $crate::get_line()
  }};
}