use std::io;
use std::cmp::Ordering;fn main() { println!("guess the number"); println!("Please input number"); let secret_num = 88; loop { let mut guess = String::new(); io::stdin().read_line(&mut guess) .ok() .expect("failed to read line"); println!("you guess {}", guess); let guess:u32 = guess.trim().parse() .ok() .expect("please input a number"); match guess.cmp(&secret_num) { Ordering::Less => println!("too small"), Ordering::Greater => println!("too large"), Ordering::Equal => { println!("you win"); break; } } }}