Cod sursa(job #2074442)
Utilizator | Lascau Ionut Sebastian lascau | Data | 24 noiembrie 2017 17:00:22 |
---|---|---|---|
Problema | Text | Scor | 40 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.46 kb |
#include <stdio.h>
#include <string.h>
int main()
{
freopen("text.in", "r", stdin);
freopen("text.out", "w", stdout);
char text[1000005];
char *p;
int nrcuv = 0;
int nrcaractere = 0;
gets(text);
p = strtok(text, " .,?!-_/][{}=+*");
while (p){
nrcuv++;
nrcaractere += strlen(p);
p = strtok(NULL, " .,?!-_/][{}=+*");
}
printf("%d", nrcaractere / nrcuv);
return 0;
}