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

29
p2.c Normal file
View file

@ -0,0 +1,29 @@
/*
* http://projecteuler.net
*
* Projecteuler - Problem 2
* -----------------------
* 2008-03-11 Henrik Hautakoski
*/
#include <stdio.h>
int main() {
int c = 0, a = 1, b = 1, r = 0;
while(c < 4000000) {
c = a+b;
a = b;
b = c;
if((c % 2) == 0)
r += c;
}
printf("%i\n", r);
return 0;
}