Cod sursa(job #6508)

Utilizator mariusdrgdragus marius mariusdrg Data 19 ianuarie 2007 21:43:53
Problema Text Scor 40
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.67 kb
#include<stdio.h>
#include<string.h>


int le;
int nr;
char c[100000];


int main()
{
        freopen("text.in","r",stdin);
        freopen("text.out","w",stdout);
        int ver=0;
        gets(c);
        int n=strlen(c);
        int c1=0;
        while(c1!=n)
        {
                if (!(('a'<=c[c1]&&c[c1]<='z')||('A'<=c[c1]&&c[c1]<='Z')))
                {

                        if (ver)nr++;
                        ver=0;
                }
                else
                {
                        ver=1;
                        le++;
                }
                c1++;
        }
        printf("%d",le/nr);
        return 0;
}