Ver Mensaje Individual
  #5  
Antiguo 29-10-2018
(MAJ) (MAJ) is offline
Miembro
 
Registrado: abr 2007
Posts: 71
Reputación: 18
(MAJ) Va por buen camino
Concuerdo con todo lo dicho arriba, debes leer la guiá de estilo para hacer un post correctamente, porque sino "todo se va a la mierda"(me disculpo por la expresión), en cuanto a tu código, el propio compilador te esta dando la respuesta...

Cita:
...dice que espera un end en vez del else ...
y ademas la forma en que escribiste el if es incorrecta, ya que no tiene la estructura básica que te comentaba CarlosReyesg
Cita:
buen día kat
recomiendo que busques en google un manual de delphi básico donde puedas leer y entender la sintaxis
y ademas debes de ser ordenada en escribir código.
ejemplo
Código Delphi [-]if answer = si then begin /////////////////////////// //escribe codigo end else begin /////////////////////////// //escribe codigo end;


http://www.delphibasics.co.uk/RTL.asp?Name=IF
http://www.delphibasics.co.uk/Article.asp?Name=Logic
http://terawiki.clubdelphi.com/Delph...phi_4_pdf_.zip
Código Delphi [-]
var
 
answer, si, no: String[5];
N, Numero, cont, cont2, sumanum: byte;
Suma, resta, Num: Integer;
prom, mul, divi, raiz, pot: Single;
acum: integer;

begin
  writeln('PROGRAMA PARA REALIZAR OPERACIONES ARITMETICAS BASICAS "N" VECES');
    writeln;
  writeln('Programado por KVSB, oct, 2018'); 
  writeln;
    writeln;
  write('¿Desea realizar una suma?: ');
  readln(answer);
  writeln;

  if answer=si then  // Comenzás con el if .. then
//begin

    writeln;   // como aquí no tenes "begin" el if solamente se aplica a esta linea
      write('¿Cuantos sumas desea realizar?: ');  // las lineas siguientes se ejecutan sin importar el if, porque no estas encerrandolas en un begin
      readln(N);
        writeln;
      for cont:=1 to n do
      begin  
        suma:=0;
            writeln;
        write('¿Cuantos numeros desea sumar?: ');
        readln(Numero);
        writeln;
          for cont2:=1 to Numero do
          begin
                writeln;
               write('Escriba un numero: ');
               Readln(num);
               acum:= acum + num;
            end;
        suma:= suma + acum;
            writeln;
        writeln('La suma de los numeros es= ', suma);
        writeln;
       end; 
//end
  else   //te da error en esta linea porque como el codigo anterior no esta encerrado en un begin .. end
    if answer = no then    //este else no esta relacionado con el if anterior 
    writeln('Enter para continuar');
    readln;
  writeln;
  writeln('Enter para finalizar');
    readln;

 end.


espero haberme dado a entender (el fernet me tiene como rehén )


P/d: bienvenida al club
Responder Con Cita