Cod sursa(job #1276179)
Utilizator | Data | 26 noiembrie 2014 00:20:43 | |
---|---|---|---|
Problema | Text | Scor | 40 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.41 kb |
#include <cstdio>
#include <cstring>
using namespace std;
FILE *fin=freopen("text.in","r",stdin);
FILE *fout=freopen("text.out","w",stdout);
char *p, S[10000000], Sep[] = " -!?.,";
int Len, Nr;
int main()
{
gets(S);
p = strtok(S, Sep);
while( p != NULL )
{
++Nr;
Len += strlen(p);
p = strtok(NULL, Sep);
}
printf("%d", Len / Nr);
return 0;
}