Cod sursa(job #405621)

Utilizator gabyca93Kuzman Gabriella gabyca93 Data 28 februarie 2010 13:54:25
Problema Text Scor 0
Compilator fpc Status done
Runda Arhiva de probleme Marime 0.63 kb
var  i,db,szo:longint;
     s:string;
     f,g:text;
Begin
assign(f,'text.in'); reset(f);
assign(g,'text.out'); rewrite(g);
readln(f,s);
db:=0; szo:=0;
for i:= 1 to length(s)-1 do
   begin
     if upcase(s[i]) in ['A'..'Z'] then db:=db+1;
     if (upcase(s[i]) in ['A'..'Z']) and
                           not (upcase(s[i+1]) in ['A'..'Z'])
                            then  szo:=szo+1;
   end;
if upcase (s[length(s)]) in ['A'..'Z'] then db:=db+1;
if (upcase (s[length(s)]) in ['A'..'Z'])and
    not(upcase(s[length(s)-1]) in ['A'..'Z']) then szo:=szo+1;


writeln(g,db,' ',szo,' ',db div szo);
close(f);
close(g);
End.