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

24
p1.c Normal file
View file

@ -0,0 +1,24 @@
/*
* http://projecteuler.net
*
* Projecteuler - Problem 1
* ------------------------
* 2008-01-21 Henrik Hautakoski
*/
#include <stdio.h>
#define mod(x) ((x % 5) == 0 || (x % 3) == 0)
int main() {
int i, r = 0;
for(i=3; i < 1000; i++)
if (mod(i)) r += i;
printf("%i\n", r);
return 0;
}