2.2 数据类型 let guess: u32 = "42".parse().expect("Not a number!"); Rust has four primary scalar types: integers, floating-point numbers, Booleans, and characters. 整数类型 u32, bits of space. Additionally, the isize and usize types depend on…
fn main() { //char支持4个字节,支持emoji let jp = "ゆ"; let emoji = "✨"; let ch = "囧"; println!("jp is {}",jp); println!("ch is {}",ch); println!("emoji is {}",emoji); //元组,同python不可变 let tup:(i32,f64,u8)…
简单练练, 夏天太热. const MAX_POINTS: u32 = 100_100; fn main() { let mut x = 5; let y = 5; let y = y + 1; let y = y * 2; let guess: u32 = "42".parse().expect("Not a number"); println!("The value of x is: {}", x); x = 6; println!(&quo…