The second task is to write and test a Fasto program, named Assign1.fo that:
1. reads from standard input an integer named n, then
2. builds a two dimensional array, named x, with n rows of irregular size in the following way:
for each row, numbered i = 0..n-1, an integer named k is read from the standard input, then
3 is added to each element of the array [0,1,...,k-1] and the result becomes the row i of array x (note that x is 2-dimensional), then
3. builds a 1-dimensional integer array, named y, of length n, in which each element y[i] is the result of summing up the elements belonging to row i of array x, and
4. reads another integer p from standard input, and if 2 < p < n then it prints and returns x[p], else it prints and returns array y.
This is a computer science assignment, but I simply can't understand what he wants us to do. hehe
This post was edited by Utunity on Nov 19 2014 12:12pm