Last active
October 21, 2021 21:38
-
-
Save Shaun289/e9d73074434f7b08c20e6cbc6c496f39 to your computer and use it in GitHub Desktop.
rust study : while loop
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// The rust programming ko https://rinthel.github.io/rust-lang-book-ko/ch03-05-control-flow.html | |
// compiled on https://play.rust-lang.org/ | |
/* result | |
* | |
** | |
*** | |
**** | |
***** | |
****** | |
******* | |
******** | |
********* | |
*/ | |
fn main() { | |
let mut row = 0; | |
while row < 10 { | |
let mut column = 0; | |
while column < row { | |
print!("*"); | |
column = column + 1; | |
} | |
println!(""); | |
row = row + 1; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment