Last active
May 5, 2018 11:32
-
-
Save ryuichiueda/3f36e7646a09b4925ebc952af6f5c3f9 to your computer and use it in GitHub Desktop.
This file contains 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
use std::env; | |
fn main(){ | |
let args: Vec<String> = env::args().collect(); | |
let num:i32 = args[1].parse::<i32>().unwrap(); | |
println!("{0: >width$ }","人", width= 2 + 2*num as usize); | |
for i in 0..num { | |
let width_left = (2*num - i*2 - 1) as usize; | |
let width_right = (i*4 + 4) as usize; | |
println!("{0:>width0$} {1:>width1$}","(",")", width0 = width_left, width1 = width_right ); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment