Problem hidden
|This problem was hidden by Editorial Board member probably because it has incorrect language|version or invalid test data, or description of the problem is not clear.|

RGB7607 - Фибаноччийн гишүүний цифр

F0=1, F1=1, Fn=Fn-1+Fn-2 томьёо өгөгдсөн бол n-р гишүүний нэгжийн цифрийг ол.

Input

Натурал тоо өгөгдөнө. 1<=n<=1000.

Output

Fn-ий сүүлийн цифр.

Example

Input: 

7

Output:

1


Нэмсэн:Bataa
Огноо:2013-01-24
Хугацааны хязгаарлалт:1s
Эх кодын хэмжээний хязгаарлалт:50000B
Memory limit:1536MB
Cluster: Cube (Intel G860)
Програмчлалын хэлүүд:ADA95 ASM32 BASH BF C NCSHARP CSHARP C++ 4.3.2 CPP C99 CLPS LISP sbcl LISP clisp D ERL FORTRAN HASK ICON ICK JAVA JS-RHINO JULIA LUA NEM NICE OCAML PAS-GPC PAS-FPC PERL PHP PIKE PRLG-swi PYTHON PYPY3 PYTHON3 RUBY SCALA SCM guile ST TCL WHITESPACE

hide comments
2024-12-12 07:21:48
aldaaga zsaachee
hooe bataa
2024-11-21 15:54:31
aldaaga zasache pisda
2023-06-11 13:25:18
C deer zuv hariug ni zuv geed avsn hun bnu
2023-03-01 02:41:11
zov hariu avhgu bdgsh
2023-01-16 03:38:47
aldaa zaagaad baina sh d ene site iig yr ni hen ajilluuldag ym be nagga
2022-11-22 09:35:30
#include<stdio.h>
main(){
unsigned int a,b[100],c;
scanf("%d",&a);
b[0]=1;
b[1]=1;
for(int i=2; i<=a; i++)
b[i]=(b[i-2]+b[i-1])%10;
printf("%d",b[a]);
}
2022-09-23 01:48:25
Scanner scan = new Scanner (System.in);
boolean f=true;
int nu1=0,a=0;
int arr[]=new int [10000];
while(f)
{ System.out.print("A=");
nu1 = scan.nextInt();
if(1<=nu1 && nu1<=1000)
{f=false;}
}
arr[0]=1;
for(int i=1;i<=1000;i++)
{
arr[i]=i;
}
a=arr[nu1-1]+arr[nu1-2];
System.out.print(a%10);
2022-06-09 07:32:42








mai malnuudaaa oilgoj huulaarai bi tsarainaasaa oor hun shuuu
import java.util.*;
import java.lang.*;

class Main
{
public static void main (String[] args) throws java.lang.Exception
{
Scanner scan = new Scanner(System.in);
int n = scan.nextInt();
long i, b = 1, a = 0, c = 1;
for(i=1; i<=n; i++) {
c = b + a;
a = b%10;
b = c%10

}
System.out.println(c%10);

}
}
mai malnuudaa
2022-06-09 06:36:38
fibonacci 7=13 8=21 sda
2022-06-09 06:34:22
bi pureveee
© Spoj.com. All Rights Reserved. Spoj uses Sphere Engine™ © by Sphere Research Labs.