Cod sursa(job #514944)
Utilizator | Data | 19 decembrie 2010 21:47:26 | |
---|---|---|---|
Problema | Text | Scor | 10 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.34 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]<65||s[i]>122)
w++;
if (s[i]==' '&&s[i+1]!=' ')
r++;
if (s[i]=='-'&&s[i+1]!='-')
r++;
}
printf("%ld",(strlen(s)-w+1)/r);
}