1
0
Fork 0

A makefile and some random fixes

This commit is contained in:
H Hautakoski 2010-08-19 08:28:02 +02:00
parent 6f7482b9f3
commit 1c210b879d
7 changed files with 47 additions and 13 deletions

12
p2.c
View file

@ -11,16 +11,18 @@
int main() {
int c = 0, a = 1, b = 1, r = 0;
int a = 1, b = 1, r = 0;
while(c < 4000000) {
for(;;) {
c = a + b;
int c = a + b;
a = b;
b = c;
if (!(c & 1))
if (~c & 1)
r += c;
if (c >= 4000000)
break;
}
printf("%i\n", r);