Código:
program exa1; uses crt; var a:array[1..7] of char; b:array[1..7] of char; c:array[1..7] of char; x:integer; estado,stop:char; begin clrscr; x:=6; writeln('Suma de digitos binarios'); writeln; a[7]:='b'; writeln('Carga del primer arreglo:'); for x:=6 downto 2 do begin; write('Escribe el valor 1/', x, ' '); readln(a[x]); end; a[1]:='b'; writeln; b[7]:='b'; writeln('Carga del segundo arreglo:'); for x:=6 downto 2 do begin; write('Escribe el valor 2/', x, ' '); readln(b[x]); end; b[1]:='b'; x:=7; estado:='1'; repeat for x:=7 downto 1 do begin; case estado of '1': begin; case a[x] of 'b': case b[x] of 'b': begin; c[x]:='b'; estado:='2'; end; end; '2': begin; case a[x] of 'b': case b[x] of 'b': begin; c[x]:='b'; estado:='1'; stop:='1'; end; '1': case b[x] of '1': begin; c[x]:='0'; estado:='3'; end; '0': begin; c[x]:='1'; estado:='2'; end; '0': case b[x] of '1': begin; c[x]:='1'; estado:='2'; end; '0': begin; c[x]:='0'; estado:='2'; end; end; '3': begin; case a[x] of 'b': case b[x] of 'b': begin; c[x]:='b'; estado:='1'; stop:='1'; end; '1': case b[x] of '1': begin; c[x]:='1'; estado:='3'; end; '0': begin; c[x]:='0'; estado:='3'; end; '0': case b[x] of '1': begin; c[x]:='0'; estado:='3'; end; '0': begin; c[x]:='1'; estado:='2'; end; end; end; until (stop='1'); for x:=1 to 7 do writeln(c[x]); readln; end.
A ver programadores ¿donde esta el error en este programa?
me marca "error in expression" el la linea
Código:
:| pero asi como es el !"#$%&&/ compilador de pascal puede ser culaquier cosa until (stop='1');