Cod sursa(job #595368)

Utilizator Athena99Anghel Anca Athena99 Data 12 iunie 2011 11:31:13
Problema Text Scor 20
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.43 kb
#include <stdio.h>

int main()
{
    int s=0,m=0,j=0;
    char c=' ',c1=' ';
    freopen("text.in","r",stdin);
    freopen("text.out","w",stdout);
    while (c!='\n')
    {
        c1=c;
        scanf("%c",&c);
        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;
}