Advertisement
Guest User

Untitled

a guest
Sep 18th, 2012
151
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.78 KB | None | 0 0
  1. 1st file
  2.  
  3. class glowna{
  4. public static void main(String[] args){
  5. przygotowanie zyx = new przygotowanie();
  6. zyx.przygotuj();
  7. }
  8. }
  9.  
  10. 2nd file
  11.  
  12. import java.util.*;
  13. class przygotowanie{
  14. Integer a;
  15. Integer b;
  16. Integer c;
  17. void przygotuj(){
  18. ArrayList<Integer> lista = new ArrayList<Integer>();
  19. a = 0;
  20. b = 1;
  21. lista.add(a);
  22. lista.add(b);
  23. c = a + b;
  24. lista.add(c);
  25. petla xyz = new petla();
  26. xyz.petla1(a, b, c, 2, 3, lista);
  27. }
  28. }
  29.  
  30. 3rd file
  31.  
  32. import java.util.*;
  33. class petla {
  34. void petla1 (Integer s, Integer n, Integer v, int f, int r, ArrayList<Integer> lista1) {
  35. int z;
  36. int y = 3;
  37. int x = 1;
  38. while (x == 1){
  39. s = lista1.get(f);
  40. n = lista1.get(r);
  41. v = s + n;
  42. lista1.add(v);
  43. z = lista1.get(y);
  44. String g = String.format("%d", z);
  45. System.out.println(g);
  46. y = y + 1;
  47. }
  48. }
  49. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement