1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
import java.lang.reflect.Array;
import java.lang.reflect.Field;

/**
 * Created by michal on 23.11.16.
 */
public class cie {

    public static void main(String[] args) throws NoSuchFieldException, IllegalAccessException {

        int d = cielib.podajD();
        int k = cielib.podajK();
        int r = cielib.podajR();

        int[] position = new int[d];

        cielib.czyCieplo(position);

        Object object = new Object();
        Field input = cielib.class.getDeclaredFields()[0];
        input.setAccessible(true);
        Object input_obj = input.get(object);

        Field pos = input.getType().getDeclaredFields()[3];
        pos.setAccessible(true);
        Object posObjArr = pos.get(input_obj);

        for(int i=0; i<d; ++i) {
            position[i] = Array.getInt(posObjArr, i);
        }

        cielib.czyCieplo(position);
        cielib.znalazlem(position);
    }
}