Cod sursa(job #1997185)
| Utilizator | Data | 3 iulie 2017 16:34:05 | |
|---|---|---|---|
| Problema | Text | Scor | 40 |
| Compilator | cpp | Status | done |
| Runda | Arhiva de probleme | Marime | 0.42 kb |
#include <fstream>
#include <cstring>
#define nmax 101
using namespace std;
ifstream fin("text.in");
ofstream fout("text.out");
void Solve()
{char s[10001],*p,cuv[10001],sep[]=" ,./?:;+'-=]()*&^%$#@!|\"";
int sum=0,nr=0;
fin.getline(s,10001);
p=strtok(s,sep);
while(p!=NULL)
{strcpy(cuv,p); p=strtok(NULL,sep);
sum+=strlen(cuv);
nr++;
}
fout<<sum/nr<<endl;
}
int main()
{Solve();
return 0;
}
