Cod sursa(job #329871)
Utilizator | Adrian Toncean madflame | Data | 7 iulie 2009 21:41:22 |
---|---|---|---|
Problema | Text | Scor | 100 |
Compilator | fpc | Status | done |
Runda | Arhiva de probleme | Marime | 0.39 kb |
Program Tex;
Var
f: Text;
c, oc: Char;
tc, nc: LongInt;
BEGIN
tc:=0; nc:=0; oc:=' ';
Assign(f,'text.in'); Reset(f);
Repeat
Read(f,c);
If c in ['A'..'Z','a'..'z'] then
Begin
Inc(tc);
If not (oc in ['A'..'Z','a'..'z']) then
Inc(nc);
End;
oc:=c;
Until Eof(f);
Close(f);
Assign(f,'text.out'); ReWrite(f);
WriteLn(f,tc div nc);
Close(f);
END.