Pascal/Turbo Pascal - type mismatch

 
Vista:

type mismatch

Publicado por adrian (4 intervenciones) el 03/08/2011 03:44:51
hola me da error de type mismatch soy principiante y no entiendo lo q pasa

program ejercicio1a;
uses crt
var
I:integer;
F:integer;
texto:string;
begin
I:=1;
F:=0;
writeln('escriba palabras con f');
readln(texto);
while(I <= length(texto)) do
begin
if([I] = ' ')then
I:=I+1;
if([I] ='f') or ([I] ='F')then
F:=F+1;
I:=I+1;
if([I] <> ' ')then
I:=I+1;
end;
end.
en teoria tiene q contar las f
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder

type mismatch

Publicado por ramon (2158 intervenciones) el 03/08/2011 13:06:14
{Fíjate en los dos textos linea a linea y veras los fallos cometidos}

program ejercicio1a;
uses
crt;
var
I:integer;
F:integer;
texto:string;
begin
I := 1;
F := 0;
writeln('escriba palabras con f');
readln(texto);
while(I <= length(texto)) do
begin
if(texto[I] = ' ')then
I := I + 1;
if(texto[I] = 'f') or (texto[I] ='F')then
F := F + 1;
I := I + 1;
if(texto[I] <> ' ')then
I := I + 1;
end;
end.
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar