while
while 关键字 的工作方式与其他语言非常相似:
fn main() { let mut x = 10; while x != 1 { x = if x % 2 == 0 { x / 2 } else { 3 * x + 1 }; } println!("x: {x}"); }