From 36eaddf3448394defc772e09416c7ef6a62771f5 Mon Sep 17 00:00:00 2001 From: impressionyang Date: Thu, 14 Nov 2024 06:54:55 +0000 Subject: [PATCH] =?UTF-8?q?update:=20=F0=9F=93=9D=20Process=20a=20Guess?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main.rs | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/src/main.rs b/src/main.rs index e7a11a9..e855586 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,3 +1,15 @@ +use std::io; + fn main() { - println!("Hello, world!"); -} + println!("Guess the number!"); + + println!("Please input your guess."); + + let mut guess = String::new(); + + io::stdin() + .read_line(&mut guess) + .expect("Failed to read line"); + + println!("You guessed: {}", guess); +} \ No newline at end of file