summary refs log tree commit diff
path: root/tests/pracownia4/02_flatten_easy.xi
blob: 207bb7cae6b806dc0fec5ce2c2e9b2b58981177b (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
printString(xs:int[])

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

    return xs
}

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

    printString(flatten_easy(xss))

    return 0
}

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