Cod sursa(job #535773)

Utilizator guralivuion ion guralivu Data 17 februarie 2011 19:11:47
Problema Text Scor 0
Compilator fpc Status done
Runda Arhiva de probleme Marime 0.61 kb
program numar;
var s,M,SS:string;
    n,C,i:integer;
    f,g:text;
begin
   assign(f,'text.in');reset(f);
   assign(g,'text.out');rewrite(g);
     readln(f,s);
     m:='qwertyuiopasdfghjklzxcvbnm';
     ss:='';
     s:=s+'*';
     for i:=1 to length(s) do
       begin
         if pos(upcase(s[i]),m)>0 then
             ss:=ss+s[i]
         else
           begin
           if pos(upcase(s[i-1]),m)>0  then
            begin
             n:=n+length(ss);
             c:=c+1;
             ss:='';
            end;
           end;
       end;
       write(g,n,' ',c);
   close(f);
   close(g);
end.