lunes, setiembre 11, 2006

PROGRAMA REINAS DE BELEZA - PARA 5TO. "C"- CLARETIANO

Program Reinas;
Uses Crt;
(*Autor: Héctor Luyo CH.*)
(*Grado: Quinto de Secundaria "C"*)
(*Fecha: 11/09/06*)
Type
matriz=Array[1..12,1..4] of Integer;
Vector=Array[1..12] of Integer;
Var m1:matriz;
v1:vector;
i,j,x,y,pos,sw,may,c:Integer;
Begin
clrscr;
Randomize;
For i:=1 to 12 Do
Begin
For j:=1 to 4 Do
Begin
m1[i,j]:=random(11);
v1[i]:=v1[i]+m1[i,j];
End;
End;
gotoxy(4,2);Writeln('Nro.');
gotoxy(11,2);write('B.');
gotoxy(16,2);write('I.');
gotoxy(21,2);write('C.');
gotoxy(26,2);write('D.');
gotoxy(33,2);write('Ptos.');
For i:=1 to 12 do
begin
gotoxy(5,i+3);write(i);
end;
y:=4;
For i:=1 to 12 Do
Begin
x:=10;
For j:=1 to 4 Do
Begin
gotoxy(x,y); write(m1[i,j]:2,' ',v1[i]:4);
Inc(x,5);
End;
Inc(y); may:=0;
End;
For I:=1 to 12 do
Begin
If v1[i]> may then
Begin
may:=v1[i];
pos:=i
end;
end;
v1[pos]:=0;
SW:=0; c:=1;
for i:=1 to 12 do
Begin
If may=v1[i] then
Begin
sw:=1;
c:=c+1;
End;
End;
Writeln;writeln;
If SW=0 then
Writeln('La Ganadora es la candidata Nro. : ',pos,' con ',may, ' puntos')
Else
writeln('No hay ganadora, exite empate entre ',c,' candidata(s)',' con ', may,' puntos');
Readkey
End.