Cod sursa(job #799232)
Utilizator | Dobre Bogdan Mihai dobrebogdan | Data | 18 octombrie 2012 13:35:56 |
---|---|---|---|
Problema | Text | Scor | 50 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.28 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=0;
m=1;
while(scanf("%c",&c)!=EOF)
{
if(isalpha(c))
n++;
else
if(c==' ')
m++;
}
printf("%ld",n/m);
return 0;
}