You are on page 1of 2

program practica;

uses wincrt;
type
matriz= array[1..3,1..4] of integer;
vector= array[1..3] of integer;
var
f,c,acum,i,j,mayor1,mayor2: integer;
A,B : matriz;
Z : vector;
prom: real;
begin
acum:=0;
writeln(' tabla de ventas');
writeln('');
for f:=1 to 3 do
for c:=1 to 4 do
begin
write(' ingresar la cant. del producto ',f,c,': ');
readln(A[f,c]);
end;
writeln('');
for f:=1 to 3 do
begin
write(' indicar precio',f,': ');
readln(Z[f]);
end;
for f:=1 to 3 do
for c:=1 to 4 do
begin
B[f,c]:= A[f,c]*Z[f];
acum:= acum+B[f,c];
end;
writeln('');
writeln('cantidad de los productos:');
for f:=1 to 3 do
begin
for c:=1 to 4 do
write(' ',A[f,c], ' ');
writeln('');
end;
writeln('');
writeln('lista de precios: ');
for f:=1 to 3 do
writeln(' ',Z[f]);
writeln('');
writeln('total de ventas por precios:');
for f:=1 to 3 do
begin
for c:=1 to 4 do
write(' ',B[f,c], ' ');
writeln(' ');
end;
prom:= acum/12;
writeln('');
writeln('la suma total en ventas es de: ',acum,' Bolivares.');
writeln('el promedio de las ventas es: ',prom:2:2);
writeln('');
write('verificar fila total_precios: ');
readln(f);
mayor1:= B[f,c];
for c:=1 to 4 do
if B[f,c]>mayor1 then
mayor1:= B[f,c];
writeln('la mayor cantidad vendida fue de ',mayor1,' Bs.');
writeln('');
write('verificar columna producto del vendedor: ');
readln(c);
mayor2:= A[f,c];
for f:=1 to 3 do
if A[f,c]>mayor2 then
mayor2:= A[f,c];
writeln('se vendio mas el producto de ',mayor2,' Und.');
end.