Cod sursa(job #514949)

Utilizator paunmatei7FMI Paun Matei paunmatei7 Data 19 decembrie 2010 21:52:33
Problema Text Scor 20
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.36 kb
#include<stdio.h>
#include<string.h>
long i,r,w;
char s[100000];
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]>65&&s[i]<=122)
			r++;
		if (s[i]=='-'&&s[i+1]>65&&s[i]<=122)
			r++;
	}
	printf("%ld",(strlen(s)-w)/r);
}