use std::{
fmt::Display,
io::stdin,
ops::{Shl, Shr},
str::FromStr,
};
pub mod views;
#[allow(non_camel_case_types)]
pub struct cout;
impl<T> Shl<T> for cout
where
T: Display,
{
type Output = Self;
fn shl(self, rhs: T) -> Self::Output {
print!("{rhs}");
self
}
}
#[allow(non_camel_case_types)]
pub struct endl;
impl Display for endl {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
writeln!(f)
}
}
#[allow(non_camel_case_types)]
pub struct cin;
impl<T> Shr<&mut T> for cin
where
T: FromStr,
{
type Output = Result<(), T::Err>;
fn shr(self, rhs: &mut T) -> Self::Output {
let mut input = String::new();
stdin().read_line(&mut input).unwrap();
*rhs = input.trim().parse()?;
Ok(())
}
}