init p1 to p9
This commit is contained in:
commit
8498165fef
9 changed files with 371 additions and 0 deletions
31
p5.c
Normal file
31
p5.c
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
|
||||
/*
|
||||
* http://projecteuler.net
|
||||
*
|
||||
* Projecteuler - Problem 5
|
||||
* ------------------------
|
||||
* 2008-03-11 Henrik Hautakoski
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
int main() {
|
||||
|
||||
int i, n = 20;
|
||||
char r;
|
||||
|
||||
do {
|
||||
r = 0;
|
||||
for(i=20; i > 10; i--) {
|
||||
if ((n % i) != 0) {
|
||||
n += 20;
|
||||
r = 1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
} while(r);
|
||||
|
||||
printf("%i\n", n);
|
||||
|
||||
return 0;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue