exercism-c/pythagorean-triplet
Blizzard Finnegan b92478b09c
Init commit
Leap, Difference of Squares, Grains, Collatz Conjecture, Queen Attack,
Darts, Hamming, and Space Age completed yesterday.

Binary and Linked List completed today.
2025-01-11 18:45:47 -05:00
..
.exercism Init commit 2025-01-11 18:45:47 -05:00
test-framework Init commit 2025-01-11 18:45:47 -05:00
HELP.md Init commit 2025-01-11 18:45:47 -05:00
makefile Init commit 2025-01-11 18:45:47 -05:00
pythagorean_triplet.c Init commit 2025-01-11 18:45:47 -05:00
pythagorean_triplet.h Init commit 2025-01-11 18:45:47 -05:00
README.md Init commit 2025-01-11 18:45:47 -05:00
test_pythagorean_triplet.c Init commit 2025-01-11 18:45:47 -05:00

Pythagorean Triplet

Welcome to Pythagorean Triplet on Exercism's C Track. If you need help running the tests or submitting your code, check out HELP.md.

Instructions

A Pythagorean triplet is a set of three natural numbers, {a, b, c}, for which,

a**2 + b**2 = c**2

and such that,

a < b < c

For example,

3**2 + 4**2 = 9 + 16 = 25 = 5**2.

Given an input integer N, find all Pythagorean triplets for which a + b + c = N.

For example, with N = 1000, there is exactly one Pythagorean triplet for which a + b + c = 1000: {200, 375, 425}.

Source

Created by

  • @wolf99

Contributed to by

  • @ryanplusplus

Based on

Problem 9 at Project Euler - http://projecteuler.net/problem=9