Cod sursa(job #1821497)
| Utilizator | Data | 3 decembrie 2016 11:21:37 | |
|---|---|---|---|
| Problema | Text | Scor | 40 |
| Compilator | cpp | Status | done |
| Runda | x_test2 | Marime | 0.46 kb |
#include <fstream>
#include <cstring>
using namespace std;
ifstream f("text.in");
ofstream g("text.out");
int K,i,j,k,S;
char s[20056], cuv[2001][206], *p;
int main()
{
f.getline(s, 20056);
K=0;
p=strtok(s," !@*()_+[]\;':-?.,%=|><");
while(p) {
K++;
strcpy(cuv[K],p);
p=strtok(NULL, " !@*()_+[]\;':-?.,%=|><");
}
S=0;
for(i=1;i<=K;i++) {
S+=strlen(cuv[i]);
}
g<<S/K;
return 0;
}
