1
0
Fork 0

init p1 to p9

This commit is contained in:
Henrik Hautakoski 2010-04-06 06:48:23 +02:00
commit 8498165fef
9 changed files with 371 additions and 0 deletions

22
p6.c Normal file
View file

@ -0,0 +1,22 @@
/*
* http://projecteuler.net
*
* Projecteuler - Problem 6
* ------------------------
* 2008-03-13 Henrik Hautakoski
*/
#include <stdio.h>
int main() {
int i, s1 = 1, s2 = 1;
for(i=2; i <= 100; i++) {
s1 += i*i;
s2 += i;
}
printf("%i\n", s2*s2 - s1);
}