rust!
parent
1dc3b030e0
commit
4c6bfa1821
|
@ -3,3 +3,4 @@
|
|||
c/binaries
|
||||
*/bin/*
|
||||
*.dwarf
|
||||
rust/target
|
||||
|
|
|
@ -0,0 +1,4 @@
|
|||
[[package]]
|
||||
name = "euler-rust"
|
||||
version = "0.1.0"
|
||||
|
|
@ -0,0 +1,6 @@
|
|||
[package]
|
||||
name = "euler-rust"
|
||||
version = "0.1.0"
|
||||
authors = ["evan hemsley <evan.hemsley@gmail.com>"]
|
||||
|
||||
[dependencies]
|
|
@ -0,0 +1 @@
|
|||
pub mod problem_001;
|
|
@ -0,0 +1,13 @@
|
|||
fn solution() -> i32 {
|
||||
return (1..1000).filter( |n| (n % 3 == 0) || (n % 5 == 0)).sum();
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use euler::problem_001::solution;
|
||||
|
||||
#[test]
|
||||
fn problem_001() {
|
||||
assert_eq!(solution(), 233168);
|
||||
}
|
||||
}
|
|
@ -0,0 +1 @@
|
|||
pub mod euler;
|
Loading…
Reference in New Issue