entrada, argumento, bucles y condición

This commit is contained in:
2023-06-02 18:44:19 +02:00
parent c945ae68ec
commit bf9b2271d0
9 changed files with 105 additions and 1 deletions

8
bucles/Cargo.toml Normal file
View File

@@ -0,0 +1,8 @@
[package]
name = "bucles"
version = "0.1.0"
edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]

7
bucles/src/main.rs Normal file
View File

@@ -0,0 +1,7 @@
fn main() {
let mi_arreglo = ["Lovecraft", "Poe", "Barker", "King"];
for (pos, apellido) in mi_arreglo.iter().enumerate() {
println!("{} esta en la posicion {}", apellido, pos);
}
}