22 lines
530 B
Rust
22 lines
530 B
Rust
fn main() {
|
|
let vowels = vec!['a', 'e', 'i', 'o', 'u'];
|
|
let words = vec!["flow", "fool", "dick", "cock", "sex", "ape", "eel", "apple", "addicted", "ore"];
|
|
|
|
for word in words {
|
|
let c = word.chars().next().unwrap();
|
|
|
|
let mut adj = format!("-{c}ay");
|
|
|
|
for vowel in vowels.iter() {
|
|
if c != *vowel {
|
|
continue;
|
|
}
|
|
|
|
adj = String::from("-hay");
|
|
break;
|
|
}
|
|
|
|
let w = String::from(word) + &adj;
|
|
println!("{w}");
|
|
}
|
|
}
|