Cod sursa(job #1948232)
Utilizator | Data | 31 martie 2017 21:34:24 | |
---|---|---|---|
Problema | Text | Scor | 100 |
Compilator | c | Status | done |
Runda | Arhiva de probleme | Marime | 0.54 kb |
#include <stdio.h>
#include <ctype.h>
int main()
{
int nr,nrcuv;
char c,c1;
freopen("text.in","r",stdin);
freopen("text.out","w",stdout);
c=getchar();
c1=0;
nr=0;
nrcuv=0;
while(c!=EOF)
{
if(isalpha(c))
nr++;
if(isalpha(c1) && !isalpha(c))
nrcuv++;
c1=c;
c=getchar();
}
if(isalpha(c1) && !isalpha(c))
nrcuv++;
if(nrcuv>0)
printf("%d\n",nr/nrcuv);
else
printf("0\n");
return 0;
}