2016 Update
This commit is contained in:
parent
948b86eafa
commit
dcf5d15da3
7965 changed files with 139854 additions and 31002 deletions
23
Task/Multiplication-tables/Rust/multiplication-tables.rust
Normal file
23
Task/Multiplication-tables/Rust/multiplication-tables.rust
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
const LIMIT: i32 = 12;
|
||||
|
||||
fn main() {
|
||||
for i in 1..LIMIT+1 {
|
||||
print!("{:3}{}", i, if LIMIT - i == 0 {'\n'} else {' '})
|
||||
}
|
||||
for i in 0..LIMIT+1 {
|
||||
print!("{}", if LIMIT - i == 0 {"+\n"} else {"----"});
|
||||
}
|
||||
|
||||
for i in 1..LIMIT+1 {
|
||||
for j in 1..LIMIT+1 {
|
||||
if j < i {
|
||||
print!(" ")
|
||||
} else {
|
||||
print!("{:3} ", j * i)
|
||||
}
|
||||
}
|
||||
println!("| {}", i);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue