Skip to content

Instantly share code, notes, and snippets.

@vivax3794
Created June 14, 2020 16:47
Show Gist options
  • Save vivax3794/8826de9b8411bded3dfb825276c26937 to your computer and use it in GitHub Desktop.
Save vivax3794/8826de9b8411bded3dfb825276c26937 to your computer and use it in GitHub Desktop.
use std::io;
macro_rules! parse_input {
($x:expr, $t:ident) => ($x.trim().parse::<$t>().unwrap())
}
/**
* Auto-generated code below aims at helping you parse
* the standard input according to the problem statement.
**/
fn main() {
let mut input_line = String::new();
io::stdin().read_line(&mut input_line).unwrap();
let sentence = input_line.trim_end().to_string();
let mut o: Vec<String> = Vec::new();
let v = String::from("aeiouAEIOU");
for x in sentence.split_whitespace() {
o.push(
x
.chars()
.map(|c| if v.contains(c) {1} else {0})
.sum::<i128>()
.to_string()
)
}
println!("{}", o.join(" "))
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment