Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- void fib(unsigned int);
- auto main(int argc, char** argv) -> int {
- unsigned int x;
- while(std::cin >> x) fib(x);
- return 0;
- }
- auto fib(unsigned int x) -> void {
- long i = 0, j = 1;
- for(int k = 0; k < 50; k++) {
- if(k == 0) std::cout << i*x << std::endl;
- if(k == 1) std::cout << j*x << std::endl;
- j += i;
- i = j - i;
- std::cout << j*x << std::endl;
- }
- return;
- }
Add Comment
Please, Sign In to add comment