feat: Taking input

This commit is contained in:
2026-01-18 20:12:59 +05:30
parent 1cc0918255
commit c0c3dc2c9f
2 changed files with 19 additions and 1 deletions

7
Cargo.lock generated Normal file
View File

@@ -0,0 +1,7 @@
# This file is automatically @generated by Cargo.
# It is not intended for manual editing.
version = 4
[[package]]
name = "guessing-game"
version = "0.1.0"

View File

@@ -1,3 +1,14 @@
use std::io;
fn main() {
println!("Hello, world!");
println!("===================== Guessing Game =====================\n");
println!("Input your guess");
let mut guess = String::new();
io::stdin()
.read_line(&mut guess)
.expect("Failed to read line");
println!("You guessed: {}", guess);
}