|
|
back to boardNo subject Posted by PULSAR 18 Feb 2018 19:07 import java.util.Scanner; public class das { /** * @param args */ public static void main(String[] args) { // TODO Auto-generated method stub Scanner sc = new Scanner(System.in); int n = sc.nextInt(); long mas[] = new long[46]; mas[0] = 2; mas[1] = 2;
for(int i=2;i<46;i++){ mas[i] = mas[i-1]+mas[i-2]; }
System.out.print(mas[n-1]);
} } |
|
|