Cod sursa(job #708941)
Utilizator | Data | 7 martie 2012 16:05:38 | |
---|---|---|---|
Problema | Text | Scor | 20 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.37 kb |
#include <stdio.h>
#include <string.h>
#include <ctype.h>
char c;
int main()
{
freopen("text.in","r",stdin);
freopen("text.out","w",stdout);
long long sum=0,nrc=0;
bool k=0;
while(scanf("%c",&c)!=EOF)
{
if((c>='a' && c<='z')||(c>='A' && c<='Z'))
{
k=1;
sum++;
}
else
if(k==1)
nrc++;
}
printf("%lld\n",sum/nrc);
return 0;
}