Cod sursa(job #799226)
Utilizator | Dobre Bogdan Mihai dobrebogdan | Data | 18 octombrie 2012 13:29:36 |
---|---|---|---|
Problema | Text | Scor | 40 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.31 kb |
#include<stdio.h>
#include<ctype.h>
int main()
{
freopen("text.in","r",stdin);
freopen("text.out","w",stdout);
char c;
long n,m;
n=1;
m=1;
scanf("%c",&c);
while(scanf("%c",&c)!=EOF)
{
if(isalpha(c))
n++;
if(c==' ' || (c=='-' && n>1))
m++;
}
printf("%ld",n/m);
return 0;
}