mirror of
https://github.com/KaiserY/trpl-zh-cn
synced 2025-05-02 19:28:19 +08:00
22 lines
451 B
Rust
22 lines
451 B
Rust
|
fn main() {
|
||
|
let mut count = 0;
|
||
|
'counting_up: loop {
|
||
|
println!("count = {}", count);
|
||
|
let mut remaining = 10;
|
||
|
|
||
|
loop {
|
||
|
println!("remaining = {}", remaining);
|
||
|
if remaining == 9 {
|
||
|
break;
|
||
|
}
|
||
|
if count == 2 {
|
||
|
break 'counting_up;
|
||
|
}
|
||
|
remaining -= 1;
|
||
|
}
|
||
|
|
||
|
count += 1;
|
||
|
}
|
||
|
println!("End count = {}", count);
|
||
|
}
|