
problema
Publicado por a (2 intervenciones) el 06/08/2021 17:02:53
Presento un pequeño problema por favor ayudenme
Program acrividad;
uses crt;
var
edad,c5,c4,c3,c2,c1,edades,io,pa,z:INTEGER;
a,ve,ex : char;
Begin
clrscr;
c1 := 0;
c2 := 0;
c3 := 0;
c4 := 0;
c5 := 0;
repeat
writeln ('Por favor indicanos tu edad');
read (edad);
if edad >= 18 then
begin
writeln('Por favor indicanos su nacionalidad');
writeln('ve o ex');
read (a);
if a=ve then
begin
writeln('Por favor indicanos que candidato desea votar');
writeln('1: candidato HCF');
writeln('2: candidato HCR');
writeln('3: candidato MM');
writeln('4: candidato LP');
writeln('5: candidato KZ');
read (io);
case io of
1:
begin
c1:=c2+1;
end;
2:
begin
c2:=c2+1;
end;
3:
begin
c3:=c3+1;
end;
4:
begin
c4:=c4+1;
end;
5:
begin
c5:=c5+1;
end;
end;
end
else
begin
writeln('No puede votar usted no es venezolano');
end;
end
else
begin
writeln('Eres menor de edad no puedes votar');
end;
writeln('¿Todavia hay personas en espera?');
writeln('1:si');
writeln('2:no');
read(io);
until io:=2
writeln('el candidato HCR obtuvo' ,c2 'votos');
writeln('el candidato MM obtuvo',c3'votos');
writeln('el candidato LP obtuvo',c4'votos');
writeln('el candidato KZ obtuvo',c5'votos');
mayor:=c1;
if c2>mayor then
begin
mayor :=2;
end;
if c3>mayor then
begin
mayor :=3;
end;
if c4>mayor then
begin
mayor :=4;
end;
if c5>mayor then
begin
mayor :=5;
end;
writeln('El ganador obtuvo',mayor);
readkey;
end.
Program acrividad;
uses crt;
var
edad,c5,c4,c3,c2,c1,edades,io,pa,z:INTEGER;
a,ve,ex : char;
Begin
clrscr;
c1 := 0;
c2 := 0;
c3 := 0;
c4 := 0;
c5 := 0;
repeat
writeln ('Por favor indicanos tu edad');
read (edad);
if edad >= 18 then
begin
writeln('Por favor indicanos su nacionalidad');
writeln('ve o ex');
read (a);
if a=ve then
begin
writeln('Por favor indicanos que candidato desea votar');
writeln('1: candidato HCF');
writeln('2: candidato HCR');
writeln('3: candidato MM');
writeln('4: candidato LP');
writeln('5: candidato KZ');
read (io);
case io of
1:
begin
c1:=c2+1;
end;
2:
begin
c2:=c2+1;
end;
3:
begin
c3:=c3+1;
end;
4:
begin
c4:=c4+1;
end;
5:
begin
c5:=c5+1;
end;
end;
end
else
begin
writeln('No puede votar usted no es venezolano');
end;
end
else
begin
writeln('Eres menor de edad no puedes votar');
end;
writeln('¿Todavia hay personas en espera?');
writeln('1:si');
writeln('2:no');
read(io);
until io:=2
writeln('el candidato HCR obtuvo' ,c2 'votos');
writeln('el candidato MM obtuvo',c3'votos');
writeln('el candidato LP obtuvo',c4'votos');
writeln('el candidato KZ obtuvo',c5'votos');
mayor:=c1;
if c2>mayor then
begin
mayor :=2;
end;
if c3>mayor then
begin
mayor :=3;
end;
if c4>mayor then
begin
mayor :=4;
end;
if c5>mayor then
begin
mayor :=5;
end;
writeln('El ganador obtuvo',mayor);
readkey;
end.
Valora esta pregunta


0