Cod sursa(job #1591290)
| Utilizator | Data | 5 februarie 2016 23:10:53 | |
|---|---|---|---|
| Problema | Text | Scor | 0 |
| Compilator | fpc | Status | done |
| Runda | Arhiva de probleme | Marime | 0.59 kb |
Program text1;
Var fi,fo:text;
s:ansistring;
i,k,m:integer;
Const mici:set of char=['a'..'z'];
mari:set of char=['A'..'Z'];
Begin
assign(fi,'text.in');
assign(fo,'text.out');
reset(fi);
s:=' ';
while not(eof(fi)) do read(fi,s);
close(fi);
rewrite(fo);
for i:=1 to length(s) do begin
if (s[i] in mici)or(s[i] in mari) then inc(k);
if (s[i]='-')or(s[i]=' ') then inc(m);
end;
if (s[1]='-')and(s[2]=' ') then dec(m,2);
if (s[1]=' ')and(s[2]='-') then dec(m,2);
Write(fo,k div(m+1) );
close(fo);
end.
