Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.* ;
- class Ppa1_cv06_1_A14B0537P {
- public static void main(String[]args)
- {
- Scanner sc = new Scanner(System.in);
- int pocetClenu = sc.nextInt() ;
- int a0 = 0 ;
- int a1 = 1 ;
- int a2 = 1 ;
- System.out.println("---Vysledky---") ;
- if (pocetClenu == 0)
- {
- System.out.println("[0]") ;
- }
- else if (pocetClenu == 1)
- {
- System.out.println("[0, 1]") ;
- }
- else if (pocetClenu == 2)
- {
- System.out.println("[0, 1, 1]") ;
- }
- else
- {
- int [] pole = new int[1];
- }
- pole = dalsiClen(pole);
- for (int i= 1; i <= pocetClenu; i++, pole = dalsiClen(pole))
- System.out.println(Arrays.toString(pole));
- }
- static int[] dalsiClen(int[] pole)
- {
- pole[pole.length -1] = pole[pole.length-2] + pole[pole.length-3];
- return pole ;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement