Untitled
raw download clone
TEXT
views 21
,
size 601 b
public int nwd(int a, int b) {
        if (a == b) return b;
        else if (a == b) return a;
        else if (b == 0) return a;
        else {
            while (a != b) {
                if (a > b)
                    a -= b;
                else
                    b -= a;
            }
            return a;
        }
    }

    public void wypełnijMacierz(int n) {

        for (int i = 0; i < n; i++) {
            for (int j = 0; j < n; j++) {
                int a = i;
                int b = j;
                tab[i][j] = nwd(27,3);
            }
        }
    }
close fullscreen
Login or Register to edit or fork this paste. It's free.