Cod sursa(job #980044)
Utilizator | Data | 3 august 2013 19:50:51 | |
---|---|---|---|
Problema | Text | Scor | 30 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.44 kb |
#include<stdio.h>
#include<ctype.h>
#include<string.h>
char s[1000005];
int main()
{
freopen("text.in","r",stdin);
freopen("text.out","w",stdout);
unsigned n,i,m=0,l=0;
gets(s);
n=strlen(s);
for(i=0;i<n;i++)
{
m++;
while(isalpha(s[i]) || s[i]=='-')
{
i++;
if(s[i]!='-')
l++;
}
}
printf("%u\n",l/m);
return 0;
}