Cod sursa(job #1039066)

Utilizator Alex1199Alex Bercea Alex1199 Data 22 noiembrie 2013 14:26:05
Problema Text Scor 40
Compilator fpc Status done
Runda Arhiva de probleme Marime 0.79 kb
Program Texte; uses crt;
   var s : ansistring;
       i, j, k : longint;
       f, g : text;
 Procedure Citeste;
  begin
    Assign(g,'text.in');
     Reset(G);
      Read(g,s);
    Close(G);
  End;
 Procedure Scrie;
  Begin
    Assign(f,'text.out');
      Rewrite(F);
      if k=1 then j:=1;
      if k=0 then
      begin
       j:=0; k:=1;
      end;
      Write(F,j div k);
    Close(F);
  End;
 Procedure NumaraCuvinte;
  Begin
  S:=' '+S;  k:=0;  j:=0;
   For i:=1 to Length(S) do
     Begin
       If  (not (S[i] in ['a'..'z','A'..'Z','0'..'9'])) and (S[i+1] in ['a'..'z','A'..'Z']) then
           k:=k+1;
        If S[i] in ['a'..'z','A'..'Z'] then
           j:=j+1;
     End;
  End;
Begin
    Citeste;
    NumaraCuvinte;
    Scrie;
 Readln;
End.