Advertisement
Guest User

Untitled

a guest
Oct 31st, 2014
133
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.13 KB | None | 0 0
  1. import java.util.* ;
  2. class Ppa1_cv06_1_A14B0537P {
  3. public static void main(String[]args)
  4. {
  5. Scanner sc = new Scanner(System.in);
  6. int pocetClenu = sc.nextInt() ;
  7. int a0 = 0 ;
  8. int a1 = 1 ;
  9. int a2 = 1 ;
  10. System.out.println("---Vysledky---") ;
  11. if (pocetClenu == 0)
  12. {
  13. System.out.println("[0]") ;
  14. }
  15. else if (pocetClenu == 1)
  16. {
  17. System.out.println("[0, 1]") ;
  18. }
  19. else if (pocetClenu == 2)
  20. {
  21. System.out.println("[0, 1, 1]") ;
  22. }
  23. else
  24. {
  25. int [] pole = new int[1];
  26. }
  27. pole = dalsiClen(pole);
  28. for (int i= 1; i <= pocetClenu; i++, pole = dalsiClen(pole))
  29. System.out.println(Arrays.toString(pole));
  30.  
  31. }
  32. static int[] dalsiClen(int[] pole)
  33. {
  34. pole[pole.length -1] = pole[pole.length-2] + pole[pole.length-3];
  35. return pole ;
  36. }
  37. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement