Cod sursa(job #980051)

Utilizator dobrebogdanDobre Bogdan Mihai dobrebogdan Data 3 august 2013 20:04:21
Problema Text Scor 40
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.49 kb
#include<stdio.h>
#include<ctype.h>
#include<string.h>
char s[1500000];
int main()
{
    freopen("text.in","r",stdin);
    freopen("text.out","w",stdout);
    unsigned n,i,m=0,l=0;
    bool t=0;
    gets(s);
    n=strlen(s);
    for(i=0;i<n;i++)
    {
        if(isalpha(s[i]))
        {
        l++;
        t=1;
        }
        else
        {
        if(t)
        {
            m++;
            t=0;
        }
        }
    }
    printf("%u\n",l/m);
    return 0;
}