Cod sursa(job #245198)
| Utilizator | Data | 17 ianuarie 2009 10:42:54 | |
|---|---|---|---|
| Problema | Text | Scor | 40 |
| Compilator | cpp | Status | done |
| Runda | Arhiva de probleme | Marime | 0.48 kb |
#include<stdio.h>
#include<string.h>
int what(char c)
{
if(c>='a'&&c<='z'||c>='A'&&c<='Z')
return 1;
return 0;
}
int main()
{
char board[131080];
int overall=0,words=0,enter=0,i,n;
freopen("text.in","r",stdin);
freopen("text.out","w",stdout);
gets(board);
n=strlen(board);
for(i=0;i<n;++i)
{
enter=0;
while(what(board[i])||i==n)
{
if(!enter)
{
++words;
enter=1;
}
++overall;
++i;
}
}
printf("%d",overall/words);
}