Cod sursa(job #1491922)
Utilizator | Data | 26 septembrie 2015 15:35:30 | |
---|---|---|---|
Problema | Text | Scor | 40 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.4 kb |
#include <cstdio>
#include <cstring>
using namespace std;
char s[1000000], sep[] = " -,?!.", *p;
int main() {
freopen("text.in", "r", stdin);
freopen("text.out", "w", stdout);
gets(s);
int n = 0, let = 0;
p = strtok(s, sep);
while(p) {
++ n;
let += strlen(p);
p = strtok(NULL, sep);
}
printf("%d", let / n);
return 0;
}