Add testaufgaben

This commit is contained in:
2022-07-23 15:03:34 +02:00
parent e416100ee5
commit 2a96cbeb88
3 changed files with 33 additions and 0 deletions

14
testaufgaben/vokale/.gitignore vendored Normal file
View File

@@ -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

View File

@@ -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]

View File

@@ -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;
}
}