Cod sursa(job #1396618)
| Utilizator | Data | 22 martie 2015 19:24:28 | |
|---|---|---|---|
| Problema | Text | Scor | 100 |
| Compilator | cpp | Status | done |
| Runda | Arhiva de probleme | Marime | 0.56 kb |
#include <cstdio>
#include <cstring>
#include <cctype>
using namespace std;
int n , crt , lg , nr , total;
char A[1000010];
int main()
{
freopen("text.in","r",stdin);
freopen("text.out","w",stdout);
while (gets(A + 1))
{
n = strlen(A + 1);
crt = 1;
while (crt <= n)
{
lg = 0;
while (isalpha(A[crt])) lg++ , crt++;
if (lg == 0) crt++;
else nr++;
total += lg;
}
}
printf("%d\n", total / nr);
return 0;
}
