Cod sursa(job #4400)

Utilizator ProtomanAndrei Purice Protoman Data 3 ianuarie 2007 01:00:08
Problema Text Scor 100
Compilator fpc Status done
Runda Arhiva de probleme Marime 0.55 kb
var f1,f2:text; c,c1:char; l,cu,a,a1,x:longint;
begin
assign(f1,'text.in');
reset(f1);
assign(f2,'text.out');
rewrite(f2);
read(f1,c);
c1:=c;
a:=ord(c);
if ((a>64)and(a<91))or((a>96)and(a<123)) then inc(l);
if ((a>64)and(a<91))or((a>96)and(a<123)) then inc(cu);
while not(eof(f1)) do begin
c1:=c;
read(f1,c);
a1:=ord(c1);
a:=ord(c);
if (((a<123)and(a>96))or((a<91)and(a>64)))and((a1<65)or(a1>122)or((a1>90)and(a1<97))) then inc(cu);
if ((a>64)and(a<91))or((a>96)and(a<123)) then inc(l);
end;
x:=l div cu;
write(f2,x);
close(f1);
close(f2);
end.