ENG  RUSTimus Online Judge
Online Judge
Problems
Authors
Online contests
About Online Judge
Frequently asked questions
Site news
Webboard
Links
Problem set
Submit solution
Judge status
Guide
Register
Update your info
Authors ranklist
Current contest
Scheduled contests
Past contests
Rules
back to board

Discussion of Problem 1225. Flags

No 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]);

    }

}