Created
June 19, 2017 18:08
-
-
Save jimjh/ca502c1e39e9ebaf47de169d288299d1 to your computer and use it in GitHub Desktop.
Project Euler P112
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pub fn search_bouncy() -> i32 { | |
//! procedural implementation | |
let mut n = 100; | |
let mut hit = 0.0; | |
let mut total = 100.0; | |
while hit / total < 0.99 { | |
n = n + 1; | |
if is_bouncy(n) { | |
hit = hit + 1.0; | |
} | |
total = total + 1.0; | |
} | |
n | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment