Current location - Plastic Surgery and Aesthetics Network - Plastic surgery and beauty - How to find the nth digit of Fibonacci number?
How to find the nth digit of Fibonacci number?
I do plastic surgery. You can also use other data types. Pay great attention to the range of data types here. The plastic I use can be up to 39 th.

# include & ltstdio.h & gt

void main()

{

int n,I;

int a[99]={ 1, 1,};

int count = 1;

Printf ("Please enter the nth digit:");

scanf("%d ",& ampn);

for(I = 2; I & ltn;; i++)

a[I]= a[I- 1]+a[I-2];

Printf ("bit %d is", n);

printf("%d\n ",a[n- 1]);

And (0! =a[n- 1]/ 10)

{

a[n- 1]= a[n- 1]/ 10;

count++;

}

Printf ("Number of digits in %d is:", n);

printf("%d\n ",count);

}

Of course, here I take A0 and A 1 as 1 and 1, and you can also take something else.