Skip to content

Instantly share code, notes, and snippets.

@rust-play
Created July 16, 2019 19:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rust-play/0e7b767402ba005e5d49ce6c973622e2 to your computer and use it in GitHub Desktop.
Save rust-play/0e7b767402ba005e5d49ce6c973622e2 to your computer and use it in GitHub Desktop.
Code shared from the Rust Playground
#![allow(unused)]
fn main() {
let input = vec![vec![8, 7, 9], vec![6, 7, 6], vec![3, 2, 5]];
for (i, row) in input.iter().enumerate(){
let max = row.iter().max();
println!("\ni = {}", i);
println!("row = {:?}", row);
println!("max = {:?}\n", max);
for (j, val) in row.iter().enumerate() {
println!("\tj = {}", j);
println!("\tval = {}", val);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment