problema con el until
Publicado por mery (8 intervenciones) el 10/10/2014 12:27:11
Hola! intentamos hacer una calculadora pero no nos copila porque dice que encuentra un until donde esperaba un punto y coma pero después de cambiarlos ponerlos y quitarlos de todas las opciones nos sigue saliendo
begin
repeat
writeln ('menu');
writeln ('1.suma');
writeln ('2.resta');
writeln ('3.multiplicacion');
writeln ('4.dividir');
writeln ('5.raiz cuadrada');
writeln ('6.inverso');
writeln ('7.salir');
read (operacion);
if operacion=1 then
begin
writeln ('operando1');
read (A);
writeln ('operando2');
read (B);
C:=A+B;
writeln (C)
end
else
begin
if operacion=2 then
begin
writeln ('operando1');
read (A);
writeln ('operando2');
read (B);
C:=A-B;
writeln (C)
end
else
begin
if operacion=3 then
begin
writeln ('numero');
read (A);
writeln ('numero');
read (B);
C:=B*A;
writeln ('resultado',C)
end
else
begin
if operacion=4 then
begin
read (A);
read (B);
if B>0 then
begin
res:= A/B;
writeln (res)
end
else
writeln ('error')
end
else
begin
if operacion=5 then
begin
read (A);
raiz:= sqrt(A);
writeln (raiz)
end
else
begin
operacion:=6;
begin
read (A);
inverso:= 1/A;
writeln (inverso)
end
end
end
until operacion=7
end.
begin
repeat
writeln ('menu');
writeln ('1.suma');
writeln ('2.resta');
writeln ('3.multiplicacion');
writeln ('4.dividir');
writeln ('5.raiz cuadrada');
writeln ('6.inverso');
writeln ('7.salir');
read (operacion);
if operacion=1 then
begin
writeln ('operando1');
read (A);
writeln ('operando2');
read (B);
C:=A+B;
writeln (C)
end
else
begin
if operacion=2 then
begin
writeln ('operando1');
read (A);
writeln ('operando2');
read (B);
C:=A-B;
writeln (C)
end
else
begin
if operacion=3 then
begin
writeln ('numero');
read (A);
writeln ('numero');
read (B);
C:=B*A;
writeln ('resultado',C)
end
else
begin
if operacion=4 then
begin
read (A);
read (B);
if B>0 then
begin
res:= A/B;
writeln (res)
end
else
writeln ('error')
end
else
begin
if operacion=5 then
begin
read (A);
raiz:= sqrt(A);
writeln (raiz)
end
else
begin
operacion:=6;
begin
read (A);
inverso:= 1/A;
writeln (inverso)
end
end
end
until operacion=7
end.
Valora esta pregunta


0