I'm having difficulty with the following question:
Create an M matrix [21,10]. Read 10 names (maximum 20 characters) and store in the first row of the array. After reading, decompose the names letter by letter and store them in the other lines of the matrix from the second. At the end, write the array.
Mycodelookslikethis:
algoritmo"Exercício 4"
var
m : vetor[1..21, 1..10] de caractere
nome : caractere
i, j : inteiro
inicio
i := 1
para j de 1 ate 10 faca
repita
escreva("Informe o nome: ")
leia(m[i, j])
se compr(m[i, j]) > 20 entao
escreval("Informe um nome com no máx. 20 caracteres.")
fimse
ate compr(m[i, j]) <= 20
fimrepita
fimpara
para i de 2 ate 21 faca
para j de 1 ate compr(m[1, j]) faca
escreval(copia(m[1, j], j, 1))
fimpara
fimpara
fimalgoritmo
I am not able to distribute the letters in the array, and the error in my code says that there is missing a make in the 5th line from the bottom up, but do it there.