基本功,走起~
一,代码
fn main() {
let mut i = 0;
while i <= 50 {
i += 1;
if i % 3 == 0 {continue;}
if i * i > 400 {break;}
print!("{} ", i * i);
}
}
二,输出
> Executing task: cargo run <
Compiling hello_rust v0.1.0 (D:\Code\hello_rust)
Finished dev [unoptimized + debuginfo] target(s) in 0.64s
Running `target\debug\hello_rust.exe`
1 4 16 25 49 64 100 121 169 196 256 289 361 400
Terminal will be reused by tasks, press any key to close it.
三,vscode编辑界面

网友评论