organizado en carpetas

This commit is contained in:
2023-07-04 12:18:40 +02:00
parent d9f4748095
commit 000f8f72a2
76 changed files with 0 additions and 21 deletions

View File

@@ -0,0 +1,8 @@
[package]
name = "tuplas"
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,28 @@
fn main() {
let (uno, dos, tres) = (1, 2, 3);
println!("Uno = {}", uno);
println!("Dos = {}", dos);
println!("Tres = {}", tres);
let tup = (3, "foo");
println!("{}", tup.0);
let tup: (i32, &str) = (3, "foo");
println!("{}", tup.0);
let mut _cambiar = (1.1f32, 1);
let aesto = (3.14f32, 6);
_cambiar = aesto;
println!("{}", aesto.0);
/* No funciona porque el tipo de dato no está en el mismo orden
let mut cambiar = (1.1f32, 1);
let aesto = (6, 3.14f32);
cambiar = aesto;
*/
}