summary refs log tree commit diff
path: root/tests/pracownia4/03_flatten_hard.xi
blob: 877a724d7d381b3bd697075b1d61712e50694374 (plain) (blame)
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
36
printString(xs:int[])

flatten_hard(xss:int[][]):int[]
{
    xs:int[] = {}
    n:int = length(xss)
    i:int = 0
    while (i < n) {
        m:int = length(xss[i])
        j:int = 0
        while (j < m) {
            xs = xs + {xss[i][j]}
            j = j + 1
        }
        i = i + 1
    }

    return xs
}

main():int
{
    xss:int[][] = { 
        "Uniwersytet",
        " ",
        "Wroclawski"
    }

    printString(flatten_hard(xss))

    return 0
}

//@PRACOWNIA
//@out Uniwersytet Wroclawski
//@out Exit code: 0