A Pythagorean triplet is a set of three natural numbers, {a, b, c}, for which,
a**2 + b**2 = c**2
For example,
3**2 + 4**2 = 9 + 16 = 25 = 5**2.
There exists exactly one Pythagorean triplet for which a + b + c = 1000.
Find the product a * b * c.
Refer to the exercism help page for Rust installation and learning resources.
Execute the tests with:
$ cargo test
All but the first test have been ignored. After you get the first test to
pass, open the tests source file which is located in the tests
directory
and remove the #[ignore]
flag from the next test and get the tests to pass
again. Each separate test is a function with #[test]
flag above it.
Continue, until you pass every test.
If you wish to run all tests without editing the tests source file, use:
$ cargo test -- --ignored
To run a specific test, for example some_test
, you can use:
$ cargo test some_test
If the specific test is ignored use:
$ cargo test some_test -- --ignored
To learn more about Rust tests refer to the online test documentation
Make sure to read the Modules chapter if you haven't already, it will help you with organizing your files.
The exercism/rust repository on GitHub is the home for all of the Rust exercises. If you have feedback about an exercise, or want to help implement new exercises, head over there and create an issue. Members of the rust track team are happy to help!
If you want to know more about Exercism, take a look at the contribution guide.
Problem 9 at Project Euler http://projecteuler.net/problem=9
It's possible to submit an incomplete solution so you can see how others have completed the exercise.