Download - Vetor e Matriz
![Page 1: Vetor e Matriz](https://reader036.vdocuments.com.br/reader036/viewer/2022082612/55cf8efb550346703b97b313/html5/thumbnails/1.jpg)
ALGORÍTMO
Os arranjos (arrays) são estruturas n-dimensionais. Iremos abordar
os arranjos unidimensionais, conhecidos como vetores
e os arranjos bi-dimensionais, conhecidos como matrizes.
![Page 2: Vetor e Matriz](https://reader036.vdocuments.com.br/reader036/viewer/2022082612/55cf8efb550346703b97b313/html5/thumbnails/2.jpg)
ALGORÍTMO
Estruturas de dados composta
Os tipos estruturados são construídos a partir dos tipos primitivos.
Permitem a uma variável armazenar múltiplos valores de um mesmo tipo primitivo
Acessa N... Posição...
![Page 3: Vetor e Matriz](https://reader036.vdocuments.com.br/reader036/viewer/2022082612/55cf8efb550346703b97b313/html5/thumbnails/3.jpg)
ALGORÍTMO
Declarando vetoresvar
<identificador> : array[limiteinferior .. limitesuperior] of <tipo dos elementos>;
VETOR
![Page 4: Vetor e Matriz](https://reader036.vdocuments.com.br/reader036/viewer/2022082612/55cf8efb550346703b97b313/html5/thumbnails/4.jpg)
ALGORÍTMO
VETOR
real : idade
real : idade(5)
real : idade(10)
![Page 5: Vetor e Matriz](https://reader036.vdocuments.com.br/reader036/viewer/2022082612/55cf8efb550346703b97b313/html5/thumbnails/5.jpg)
ALGORÍTMO
varvet1: array[2..7] of integer;vet2: array[-3..2] of char;vet3: array['A'..'F'] of real;
type tipovetor = array[1..6] of integer;varvetor : tipovetor;
VETOR
![Page 6: Vetor e Matriz](https://reader036.vdocuments.com.br/reader036/viewer/2022082612/55cf8efb550346703b97b313/html5/thumbnails/6.jpg)
ALGORÍTMO
vet1[2] := 3;
vet2[0] := 'B';
vet3['A'] := 3.2;
VETOR
![Page 7: Vetor e Matriz](https://reader036.vdocuments.com.br/reader036/viewer/2022082612/55cf8efb550346703b97b313/html5/thumbnails/7.jpg)
ALGORÍTMO
Declarando matrizes
var
<identificador>:array[l1..l2,c1..c2] of <tipo dos elementos>;
MATRIZES
![Page 8: Vetor e Matriz](https://reader036.vdocuments.com.br/reader036/viewer/2022082612/55cf8efb550346703b97b313/html5/thumbnails/8.jpg)
ALGORÍTMO
MATRIZES
![Page 9: Vetor e Matriz](https://reader036.vdocuments.com.br/reader036/viewer/2022082612/55cf8efb550346703b97b313/html5/thumbnails/9.jpg)
ALGORÍTMO
Var
Matriz1: array[1..5,1..5] of integer;
Matriz2: array[1..3,1..8] of char;
MATRIZES
![Page 10: Vetor e Matriz](https://reader036.vdocuments.com.br/reader036/viewer/2022082612/55cf8efb550346703b97b313/html5/thumbnails/10.jpg)
ALGORÍTMO
Atribuindo valores as matrizes
Matriz1[1,2]:=0;
Matriz2[3,8]:='A';
MATRIZES