diff --git a/testaufgaben/vokale/.gitignore b/testaufgaben/vokale/.gitignore new file mode 100644 index 0000000..6985cf1 --- /dev/null +++ b/testaufgaben/vokale/.gitignore @@ -0,0 +1,14 @@ +# Generated by Cargo +# will have compiled files and executables +debug/ +target/ + +# Remove Cargo.lock from gitignore if creating an executable, leave it for libraries +# More information here https://doc.rust-lang.org/cargo/guide/cargo-toml-vs-cargo-lock.html +Cargo.lock + +# These are backup files generated by rustfmt +**/*.rs.bk + +# MSVC Windows builds of rustc generate these, which store debugging information +*.pdb diff --git a/testaufgaben/vokale/Cargo.toml b/testaufgaben/vokale/Cargo.toml new file mode 100644 index 0000000..00cf6cf --- /dev/null +++ b/testaufgaben/vokale/Cargo.toml @@ -0,0 +1,8 @@ +[package] +name = "vokale" +version = "0.1.0" +edition = "2021" + +# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html + +[dependencies] diff --git a/testaufgaben/vokale/src/main.rs b/testaufgaben/vokale/src/main.rs new file mode 100644 index 0000000..dd77827 --- /dev/null +++ b/testaufgaben/vokale/src/main.rs @@ -0,0 +1,11 @@ +fn main() { + let input = String::from("Hallo"); + let mut count = 0; + for i in input.chars() { + if i == 'a' || i == 'e' || i == 'i' || i == 'o' || i == 'u' { + println!("Character: {}, Index: {}", i, count); + } + count += 1; + } + +}