Cod sursa(job #1821487)
| Utilizator | Data | 3 decembrie 2016 11:13:45 | |
|---|---|---|---|
| Problema | Text | Scor | 40 |
| Compilator | cpp | Status | done |
| Runda | x_test2 | Marime | 0.44 kb |
#include <fstream>
#include <cstring>
using namespace std;
ifstream cin ("text.in");
ofstream cout ("text.out");
int n, nr, s;
char c[1048677], aux[1048677], *p;
int main ()
{
cin.getline(c, 1048577);
p=strtok(c, " ,.-!?*;:1234567890");
nr=0;
s=0;
while (p){
nr++;
strcpy(aux, p);
s=s+strlen(aux);
p=strtok(NULL, " ,.-!?*:;1234567890");
}
cout << s/nr;
return 0;
}
