diff options
Diffstat (limited to '002.c')
| -rw-r--r-- | 002.c | 20 |
1 files changed, 20 insertions, 0 deletions
@@ -0,0 +1,20 @@ +int main() +{ + int previous = 1, next = 2; + int sum = 0, tmp = 0; + + while(next <= 4000000) + { + if(!(next & 1)) + sum += next; + + tmp = next; + next += previous; + previous = tmp; + } + + printf("%ld\n", sum); + + return 0; +} + |
