Skip to content

Instantly share code, notes, and snippets.

@wperron
Created December 6, 2021 13:57
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 wperron/53c156582cac019436c085e7e1de32cc to your computer and use it in GitHub Desktop.
Save wperron/53c156582cac019436c085e7e1de32cc to your computer and use it in GitHub Desktop.
Calculate the area of a rectagular prism
fn main() {
println!("{:?}", wrap(2, 3, 4));
}
fn wrap(l: i32, w: i32, h: i32) -> i32 {
2 * (l*w + w*h + h*l)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment