Cod sursa(job #595375)
Utilizator | Data | 12 iunie 2011 11:42:47 | |
---|---|---|---|
Problema | Text | Scor | 0 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.48 kb |
#include <stdio.h>
int main()
{
int s=0,m=0,j=0,y=1;
char c=' ',c1=' ';
freopen("text.in","r",stdin);
freopen("text.out","w",stdout);
while (c!=EOF)
{
c1=c;
if (scanf("%c",&c)) y=0;
else y=1;
if (y==1) break;
if ((int)c>64 && (int)c<123) ++s;
else if ((int)c1>64 && (int)c1<123)
{
++m;
j+=s;
s=0;
}
}
printf("%d",j/m);
return 0;
}