Cod sursa(job #514938)

Utilizator paunmatei7FMI Paun Matei paunmatei7 Data 19 decembrie 2010 21:40:40
Problema Text Scor 10
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.33 kb
#include<stdio.h>
#include<string.h>
long i,r,w;
char s[64000];
int main()
{
	freopen("text.in","r",stdin);
	freopen("text.out","w",stdout);
	gets(s);
	for (i=0;i<=strlen(s);i++)
	{
		if (s[i]==' ')
			w++;
		if (s[i]==' '&&s[i+1]!=' ')
			r++;
		if (s[i]=='-'&&s[i+1]!='-')
			r++;
	}
	printf("%ld",(strlen(s)-w)/r);
}