uses crt; type trec:record orszag:string[3]; osszdb:integer; inaktivdb:integer; end; ttomb:array[1..175] of trec; end; var adb,f:text; stomb:ttomb; max:byte; {a tomb elemszama} procedure inic(var adb,f:text); var ok:integer; sv:string[12]; begin repeat write(Kerem a bemeneti allomany nevet (txt): '); readln(s); until ((length(s)<=8) and (length(s)>1)); assign(adb,s); write('A kepernyore irjak? (nem:[n/N], minden mas igen'); readln(s); if upcase(s)='N' then assign(f,'adb-log.txt') else assigncrt(f); max:=1; end; procedure filebeolvas(var adb:text; var t:adattip); var c:char; {a "szeme'thez"} begin read(adb,t.country); read(adb,c); readln(adb,t.flag); end; procedure vane_tcountry(t:adattip; stomb:ttomb; var vane:boolean; var hol,max:integer); var i:integer; begin vane:=false; i:=1; while ((van=false) and (i<>max)) do begin if stomb[i].orszag=t.country then vane:=true; inc(i); end; end; procedure feldolgoz(var adb:text; var stomb:ttomb; var max:byte); begin while not(eof(adb)) do begin {vagy 38623} filebeolvas(adb,t); vane_tcountry(t,stomb,vane,hol,max); if vane then begin inc(stomb[hol].osszdb); if ((t.flag='i') or (t.flag='in') or or (t.flag='ie') or (t.flag='win')) then inc(stomb[hol].inaktivdb); end else begin inc(max); if ((t.flag='i') or (t.flag='in') or or (t.flag='ie') or (t.flag='win')) then begin stomb[max].osszdb:=1; stomb[max].inaktivdb:=1; end; end; end; {while} end; procedure kiiras(var f:text; stomb:ttomb; max:integer); var s,c:string; i:integer; begin for i:=1 to max do begin s:=stomb[i].orszag; write(f,s); s:=stomb[i].osszdb; s:=': '+s; write(f,s); s:=stomb[i].inaktivdb; s:=' / '+s; writeln(f,s); end; end; begin inic(adb,f); feldolgoz(adb,stomb,max); kiiras(f,stomb,max); end.