Cod sursa(job #799225)
Utilizator | Dobre Bogdan Mihai dobrebogdan | Data | 18 octombrie 2012 13:28:12 |
---|---|---|---|
Problema | Text | Scor | 40 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.3 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==' ')
m++;
}
printf("%ld",n/m);
return 0;
}