-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.rs
39 lines (23 loc) · 816 Bytes
/
index.rs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
use std::{i8, i16, i32, i64, u8, u16, u32, u64, isize, usize, f32, f64};
use std::io::stdin;
fn main() {
println!("Hello World!");
let num = 10;
let mut age: i32 = 40;
let is_it_true: bool = true;
let let_x: char = 'x';
println!("I am {} years old", age);
let (f_name, l_name) = ("Marcos", "Navarro");
println!("Is it {0} that {1} is {2} years old", is_it_true, f_name, age);
println!("{:.2}", 1.2345);
println!("Binary: {:b}, Hex: {:x} O: {:o}", 10, 10, 10);
println!("{ten:>ws$}", ten=10, ws=5);
println!("{ten:>0ws$}", ten=10, ws=5);
println!("5 + 4 = {}", 5 + 4);
let age_old = 6;
if age_old == 5 {
println!("Go to kindergarten");
} else if age_old > 5 && age_old < 18 {
println!("Go to grade {}", age_old - 5);
}
}