Skip to content

Instantly share code, notes, and snippets.

@goofmint
Created December 8, 2017 11:20
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 goofmint/6aae9a61987322be42fcd4824a1c0256 to your computer and use it in GitHub Desktop.
Save goofmint/6aae9a61987322be42fcd4824a1c0256 to your computer and use it in GitHub Desktop.
#[no_mangle]
pub fn sum(a: i32) -> i32 {
let mut total = 0;
for x in 0..a {
total += x;
for y in 0..a {
total += y;
}
}
total
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment