Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- int main()
- {
- system("chcp 1251");
- system("cls");
- int a,first=0,second=1,sum=1,t,count=1;
- printf("Введите число :");
- scanf("%d",&a);
- while(sum<=a) {
- count++;
- sum=first+second;
- first=second;
- second=sum;
- }
- printf("Всего чисел Фибоначчи не превосходящие %d : %d",a,count);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement