fn main() {
let rows = 3;
let cols = 4;
let matrix = vec![vec![0; cols]; rows];
for row in &matrix {
println!("{}", row.iter().map(|&x| x.to_string()).collect::<Vec<_>>().join(" "));
}
println!("\n");
for i in 0..rows {
for j in 0..cols {
print!("{} ", matrix[i][j]);
}
println!();
}
}
/*
run:
0 0 0 0
0 0 0 0
0 0 0 0
0 0 0 0
0 0 0 0
0 0 0 0
*/