Cod sursa(job #584683)

Utilizator paunmatei7FMI Paun Matei paunmatei7 Data 26 aprilie 2011 12:54:01
Problema Text Scor 30
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.42 kb
#include<stdio.h>
#include<string.h>
long r,w;
long long i;
char s[10000000];
int main()
{
    freopen("text.in","r",stdin);
    freopen("text.out","w",stdout);
    gets(s);
    for (i=0;i<=strlen(s);i++)
    {
       if (s[i]<65||s[i]>122)
            w++;
        if (s[i]==' '&&s[i+1]!=' ')
            r++;
        if (s[i]=='-'&&s[i+1]>65&&s[i+1]<=122)
			r++;
    }
    printf("%ld",(strlen(s)-w)/r);
}