Cod sursa(job #595391)
| Utilizator | Data | 12 iunie 2011 12:01:09 | |
|---|---|---|---|
| Problema | Text | Scor | 40 |
| Compilator | cpp | Status | done |
| Runda | Arhiva de probleme | Marime | 0.47 kb |
#include <stdio.h>
#include <string.h>
char c[1025000];
int main()
{
int s=0,m=0,j=0,i=0,n=0;
freopen("text.in","r",stdin);
freopen("text.out","w",stdout);
fgets(c,1024999,stdin);
n=strlen(c);
for (i=0; i<n; ++i)
{
if ((int)c[i]>64 && (int)c[i]<123) ++s;
else if ((int)c[i-1]>64 && (int)c[i-1]<123)
{
++m;
j+=s;
s=0;
}
}
printf("%d",j/m);
return 0;
}
