add while
This commit is contained in:
24
single_file_tests/while.rs
Normal file
24
single_file_tests/while.rs
Normal file
@@ -0,0 +1,24 @@
|
||||
|
||||
fn main() {
|
||||
let mut cnt = 0_u32;
|
||||
while cnt < 10 {
|
||||
print!("{} ", cnt);
|
||||
cnt += 1;
|
||||
}
|
||||
println!("");
|
||||
|
||||
for i in 0..10 {
|
||||
print!("{} ", i);
|
||||
}
|
||||
println!();
|
||||
|
||||
for i in 0..=10 {
|
||||
print!("{}", i);
|
||||
match i {
|
||||
_ if i % 2 == 0 => print!("[ORD]"),
|
||||
_ => (),
|
||||
}
|
||||
print!(" ");
|
||||
}
|
||||
println!();
|
||||
}
|
||||
Reference in New Issue
Block a user