Posts

Showing posts with the label problem 9

Special Pythagorean triplet | Project Euler | Problem #9

URL to the problem page:  https://projecteuler.net/problem=9 A Pythagorean triplet is a set of three natural numbers, a < b < c, for which, a² + b² = c² For example, 3² + 4² = 9 + 16 = 25 = 5². There exists exactly one Pythagorean triplet for which a + b + c = 1000. Find the product abc. #include   <iostream> using   namespace   std ; long   long   power ( long   long   a ,  long   long   b ) {      long   long  result =  1 ;      for  ( int  i =  0 ; i < b; i++) {         result *= a;     }      return  result; } int   main () {      long   long  i, j, k, exit =  0 , exit2 =  0 ;      for  (i =  ...
My photo
Ercan Tomac
instagram.com/ercantomac