Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- #include <stdint.h>
- int main(int argc, char** argv)
- {
- uint32_t f, s, t, x;
- uint64_t m;
- if(argc > 1 && (x = atoi(argv[1])) > 0)
- {
- f = 0;
- s = 1;
- t = 0;
- m = 1;
- for(;;)
- {
- t = f + s;
- f = s;
- s = t;
- if(s >= x) { break; }
- m += s;
- }
- printf("Sum: %llu\n", m);
- }
- return 0;
- }
Add Comment
Please, Sign In to add comment