Add testaufgaben
This commit is contained in:
14
testaufgaben/vokale/.gitignore
vendored
Normal file
14
testaufgaben/vokale/.gitignore
vendored
Normal 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
|
8
testaufgaben/vokale/Cargo.toml
Normal file
8
testaufgaben/vokale/Cargo.toml
Normal 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]
|
11
testaufgaben/vokale/src/main.rs
Normal file
11
testaufgaben/vokale/src/main.rs
Normal 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;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
Reference in New Issue
Block a user