exercism

Exercism solutions.
git clone git://code.dwrz.net/exercism
Log | Files | Refs

README.md (1756B)


      1 # Difference Of Squares
      2 
      3 Find the difference between the square of the sum and the sum of the squares of the first N natural numbers.
      4 
      5 The square of the sum of the first ten natural numbers is
      6 (1 + 2 + ... + 10)² = 55² = 3025.
      7 
      8 The sum of the squares of the first ten natural numbers is
      9 1² + 2² + ... + 10² = 385.
     10 
     11 Hence the difference between the square of the sum of the first
     12 ten natural numbers and the sum of the squares of the first ten
     13 natural numbers is 3025 - 385 = 2640.
     14 
     15 ## Getting Started
     16 
     17 Make sure you have read the "Guides" section of the
     18 [C track](https://exercism.io/my/tracks/c) on the Exercism site. This covers
     19 the basic information on setting up the development environment expected
     20 by the exercises.
     21 
     22 
     23 ## Passing the Tests
     24 
     25 Get the first test compiling, linking and passing by following the [three
     26 rules of test-driven development][3-tdd-rules].
     27 
     28 The included makefile can be used to create and run the tests using the `test`
     29 task.
     30 
     31     make test
     32 
     33 Create just the functions you need to satisfy any compiler errors and get the
     34 test to fail. Then write just enough code to get the test to pass. Once you've
     35 done that, move onto the next test.
     36 
     37 [3-tdd-rules]: http://butunclebob.com/ArticleS.UncleBob.TheThreeRulesOfTdd
     38 
     39 As you progress through the tests, take the time to refactor your
     40 implementation for readability and expressiveness and then go on to the next
     41 test.
     42 
     43 Try to use standard C99 facilities in preference to writing your own
     44 low-level algorithms or facilities by hand.
     45 
     46 ## Source
     47 
     48 Problem 6 at Project Euler [http://projecteuler.net/problem=6](http://projecteuler.net/problem=6)
     49 
     50 ## Submitting Incomplete Solutions
     51 It's possible to submit an incomplete solution so you can see how others have completed the exercise.