Cod sursa(job #884840)
| Utilizator | Data | 21 februarie 2013 13:17:04 | |
|---|---|---|---|
| Problema | Text | Scor | 70 |
| Compilator | c | Status | done |
| Runda | Arhiva de probleme | Marime | 0.64 kb |
#include<stdio.h>
char ch;
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;
nrl++;
}
}
}
}
nrc--;
//printf("c= %i\n",nrc);
//printf("l= %i\n",nrl);
printf("%ld",nrl/nrc);
return 0;
}
