摘要:
说在前面 我爱Rust If语句 正文 代码块 fn main() { let number = 3; //if表达式 //if后面必须是bool类型 if number < 5 { println!("condition was true"); } else { println!("conditi 阅读全文
posted @ 2026-02-06 16:28
Alokiria
阅读(2)
评论(0)
推荐(0)
摘要:
说在前面 Rust的表达式设计简直了…… 正文 代码块 fn main() { println!("Hello, world!"); another_function(); another_function2(32); let x = five(); println!("The value of x 阅读全文
posted @ 2026-02-06 16:19
Alokiria
阅读(3)
评论(0)
推荐(0)
摘要:
说在前面 刚接触Rust感觉语法很酷…… 正文 代码块 //全局常量 const GLOBAL_CHAR: u32 = 25; fn main() { let mut x = 5; println!("The value of x is: {x}"); x = 6; println!("The va 阅读全文
posted @ 2026-02-06 16:14
Alokiria
阅读(2)
评论(0)
推荐(0)
摘要:
第一个程序 简单的输入输出 使用use来引用库函数 代码块 use std::io::stdin; fn main() { let mut msg = String::new(); println!("Please enter message:"); stdin().read_line(&mut m 阅读全文
posted @ 2026-02-06 16:00
Alokiria
阅读(1)
评论(0)
推荐(0)

浙公网安备 33010602011771号