Cod sursa(job #316876)
| Utilizator | Data | 21 mai 2009 13:54:40 | |
|---|---|---|---|
| Problema | Text | Scor | 0 |
| Compilator | fpc | Status | done |
| Runda | Arhiva de probleme | Marime | 0.43 kb |
program text;
var s:string;
j,i,n:integer;
p,q:boolean;
begin
assign(input,'text.in');
assign(output,'text.out');
reset(input);
rewrite(output);
readln(input,s);
while i<>length(s) do
begin
p:=((s[i]>='a')and(s[i]<='z'))or((s[i]>='A')and(s[i]<='Z'));
q:=not(((s[i+1]<'a')and(s[i+1]<='z'))or((s[i+1]>='A')and(s[i+1]<='Z')));
if p then
j:=j+1 ;
if p and q then n:=n+1;
i:=i+1;
end;
writeln(output,j mod n);
end.