Bdvis...Program exer02 ;typematriz= array [1..4,1..5] of real;vetor= array [1..4] of string;mediav= array [1..4] of real;varsal:matriz;setor:vetor;I,c:integer;soma:real;media:mediav;Beginsoma:=0;for I:= 1 to 4 dobegingotoxy(2,3);writeln('nome setor:') ;gotoxy(2,4);writeln('nome setor:');gotoxy(2,5);writeln('nome setor:');gotoxy(2,6);writeln('nome setor:');gotoxy( 14, 2 + i);readln(setor[i]);for c:= 1 to 5 dobegingotoxy(20,2);writeln(' Digite Salário');gotoxy(7*c+12,2+I);readln(sal[I,c]);soma:=soma+sal[I,c];end;media[I]:=soma/5;gotoxy(50 ,2+i);writeln('Média: ');gotoxy(50 +c,2+I);writeln( media[I]:2:2);soma:=0;end;readln;End.Essa é uma das formas de resolver esse exercício!!!!!!
Bdvis...
ResponderExcluirProgram exer02 ;
type
matriz= array [1..4,1..5] of real;
vetor= array [1..4] of string;
mediav= array [1..4] of real;
var
sal:matriz;
setor:vetor;
I,c:integer;
soma:real;
media:mediav;
Begin
soma:=0;
for I:= 1 to 4 do
begin
gotoxy(2,3);
writeln('nome setor:') ;
gotoxy(2,4);
writeln('nome setor:');
gotoxy(2,5);
writeln('nome setor:');
gotoxy(2,6);
writeln('nome setor:');
gotoxy( 14, 2 + i);
readln(setor[i]);
for c:= 1 to 5 do
begin
gotoxy(20,2);
writeln(' Digite Salário');
gotoxy(7*c+12,2+I);
readln(sal[I,c]);
soma:=soma+sal[I,c];
end;
media[I]:=soma/5;
gotoxy(50 ,2+i);
writeln('Média: ');
gotoxy(50 +c,2+I);
writeln( media[I]:2:2);
soma:=0;
end;
readln;
End.
Essa é uma das formas de resolver esse exercício!!!!!!