Cod sursa(job #1081111)
Utilizator | Rotaru Alexandru Alexrotaru | Data | 13 ianuarie 2014 10:02:31 |
---|---|---|---|
Problema | Text | Scor | 20 |
Compilator | fpc | Status | done |
Runda | Arhiva de probleme | Marime | 0.42 kb |
var
a:string;
n,m,i,l:integer;
f,g:text;
begin
assign(f,'text.in');
reset(f);
assign(g,'text.out');
rewrite(g);
readln(f,a);
n:=length(a);
for i:=1 to n do
begin
if a[i]='-' then m:=m+1;
if a[i]=' ' then m:=m+1;
end;
for i:=1 to n do
begin
if a[i]='!' then l:=l+1;
if a[i]=',' then l:=l+1;
if a[i]='-' then l:=l+1;
end;
n:=n-m-l;
if a[i]='-' then m:=m-1;
writeln(g,(n div m));
close(f);
close(g);
end.