Skip to content

Commit

Permalink
add phanupongr.rs (#174)
Browse files Browse the repository at this point in the history
  • Loading branch information
phanupongr authored Oct 23, 2022
1 parent 185dac3 commit 15fda7e
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions Rust/phanupongr.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
use std::io;

fn main() {
loop {
println!("Enter only `Coffee`: ");
let stdin = io::stdin();
let mut coffee = String::new();
stdin.read_line(&mut coffee).expect("Failed to read input.");

if coffee.contains("Coffee") {
println!("{}", coffee.replace("ffe", "d"));
break
}
}
}

0 comments on commit 15fda7e

Please sign in to comment.