Cod sursa(job #595264)

Utilizator Athena99Anghel Anca Athena99 Data 11 iunie 2011 19:01:57
Problema Text Scor 0
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.46 kb
#include <stdio.h>

char v[32767];

int main()
{
    int k=0,s=0,m=0,j=0;
    freopen("text.in","r",stdin);
    freopen("text.out","w",stdout);
    k=1;scanf("%c",&v[0]);
    while (v[k-1]!=EOF)
    {
        scanf("%c",&v[k++]);
        if ((int)v[k-1]>64 && (int)v[k-1]<123) ++s;
        else if ((int)v[k-2]>64 && (int)v[k-2]<123)
        {
            ++m;
            j+=s;
            s=0;
        }
    }
    printf("%d",j/m);
    return 0;
}