trpl-zh-cn/listings/ch03-common-programming-concepts/listing-03-04/src/main.rs

11 lines
169 B
Rust
Raw Normal View History

2022-02-06 16:43:51 +08:00
fn main() {
let a = [10, 20, 30, 40, 50];
let mut index = 0;
while index < 5 {
println!("the value is: {}", a[index]);
index += 1;
}
}