转义输出: fn main() {let a = 12;println!("a = {{{}}}", a); } //a = {12} type let is_true: bool = true;println!("is_true = {}", is_true);let is_false = false;println!("is_false = {}, {}", is_false, is_true);//char 在rust里面,char是32位的let a = 'a';println!("a = {}", a);let b = '你';println!("b = {}", b);//i8, i16, i32, i64, u8, u16, u32, u64, f32, f64let c: i8 = -111;println!("c = {}", c);let d: f32 = 0.0009;println!("d = {}", d);//自适应类型isize, usizeprintln!("max = {}", usize::max_value()); 3.function fn other_fun2(a: i32, b: i32) -> i32 {let result = a + b;return result; }fn other_fun3(a: i32, b: i32) -> i32 {//let result = a + b;//resulta + b }fn main() {let a: i32 = -1;let b: u32 = 2;let c: i32 = 9;let r: i32 = other_fun2(a, c);println!("r = {}", r);let r2: i32 = other_fun3(a, c);println!("r2 = {}", r2);//语句是执行一些操作,但是不返回值的指令//let y = 1; //语句,不返回值//let x = (let y = 1);//表达式会计算一些值let y = {let x = 1;//x + 1;x + 1};println!("y = {}", y);println!("Hello, world!"); }