Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 1st file
- class glowna{
- public static void main(String[] args){
- przygotowanie zyx = new przygotowanie();
- zyx.przygotuj();
- }
- }
- 2nd file
- import java.util.*;
- class przygotowanie{
- Integer a;
- Integer b;
- Integer c;
- void przygotuj(){
- ArrayList<Integer> lista = new ArrayList<Integer>();
- a = 0;
- b = 1;
- lista.add(a);
- lista.add(b);
- c = a + b;
- lista.add(c);
- petla xyz = new petla();
- xyz.petla1(a, b, c, 2, 3, lista);
- }
- }
- 3rd file
- import java.util.*;
- class petla {
- void petla1 (Integer s, Integer n, Integer v, int f, int r, ArrayList<Integer> lista1) {
- int z;
- int y = 3;
- int x = 1;
- while (x == 1){
- s = lista1.get(f);
- n = lista1.get(r);
- v = s + n;
- lista1.add(v);
- z = lista1.get(y);
- String g = String.format("%d", z);
- System.out.println(g);
- y = y + 1;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement