|
|
back to boardCompilation error I have compilation error. But i think my program is right. {=== 1446 ===} const Slytherin = 'Slytherin'; Hufflepuff = 'Hufflepuff'; Gryffindor = 'Gryffindor'; Ravenclaw = 'Ravenclaw'; MAX = 10; var name_arr : array[1..MAX] of string; n,i,j : integer; Slytherin_arr : array[1..MAX] of string; Hufflepuff_arr : array[1..MAX] of string; Gryffindor_arr : array[1..MAX] of string; Ravenclaw_arr : array[1..MAX] of string; Slytherin_i,Hufflepuff_i,Gryffindor_i,Ravenclaw_i : integer; begin readln(n); Slytherin_i := 0; Hufflepuff_i := 0; Gryffindor_i := 0; Ravenclaw_i := 0; for i:=1 to 2*n do readln(name_arr[i]); for i:=1 to 2*n-1 do begin
if name_arr[i+1] = Slytherin then begin Slytherin_arr[i]:=name_arr[i]; inc(Slytherin_i); end;
if name_arr[i+1] = Hufflepuff then begin Hufflepuff_arr[i]:=name_arr[i]; inc(Hufflepuff_i); end;
if name_arr[i+1] = Gryffindor then begin Gryffindor_arr[i]:=name_arr[i]; inc(Gryffindor_i); end;
if name_arr[i+1] = Ravenclaw then begin Ravenclaw_arr[i]:=name_arr[i]; inc(Ravenclaw_i); end;
end; if Slytherin_i>0 then write(Slytherin,':'); writeln(''); for i:=1 to MAX do if Slytherin_arr[i]<>'' then writeln(Slytherin_arr[i]); writeln(''); end; if Hufflepuff_i>0 then write(Hufflepuff,':'); writeln(''); for i:=1 to MAX do if Hufflepuff_arr[i]<>'' then writeln(Hufflepuff_arr[i]); writeln(''); end; if Gryffindor_i>0 then write(Gryffindor,':'); writeln(''); for i:=1 to MAX do if Gryffindor_arr[i]<>'' then writeln(Gryffindor_arr[i]); writeln(''); end; if Ravenclaw_i>0 then write(Ravenclaw,':'); writeln(''); for i:=1 to MAX do if Ravenclaw_arr[i]<>'' then writeln(Ravenclaw_arr[i]); end; end. Re: Compilation error delete 67th,74th,81th,87th lines delete your code Edited by author 29.12.2006 10:50 END's WITHOUT BEGIN's Hey when you write answers you use END's WITHOUT BEGIN's here is part of your code if Hufflepuff_i>0 then write(Hufflepuff,':'); writeln(''); for i:=1 to MAX do if Hufflepuff_arr[i]<>'' then writeln(Hufflepuff_arr[i]); writeln(''); end; {==Here is END but Where is BEGIN?!?!?!?!?!==} |
|
|