Cod sursa(job #884871)

Utilizator romykPrehari Romica romyk Data 21 februarie 2013 13:46:28
Problema Text Scor 90
Compilator c Status done
Runda Arhiva de probleme Marime 0.68 kb
#include<stdio.h>

char ch;
long long int i,j,nrl,nrc,ok;

int main(void)
{
    freopen("text.in","r",stdin);
    freopen("text.out","w",stdout);


    while((ch=getchar())!=EOF)
    {
        if((ch>='a'&&ch<='z')||(ch>='A'&&ch<='Z'))
              nrl++;
        else
          {nrc++;
           ok=1;
          while(ok==1&&ch!=EOF)
          {   ch=getchar();
              if((ch>='a'&&ch<='z')||(ch>='A'&&ch<='Z'))
              {
                  ok=0;

              }
          }
          if(ch!=EOF&&ch!='\n')
           nrl++;
          }
    }
   // printf("c= %i\n",nrc);
   // printf("l= %i\n",nrl);
   printf("%lli",nrl/nrc);
   return 0;
}