Cod sursa(job #444853)
Utilizator | Data | 21 aprilie 2010 21:27:25 | |
---|---|---|---|
Problema | Text | Scor | 60 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.36 kb |
#include<fstream>
using namespace std;
char a[257],*p;
long i,n,m;
int main()
{
ifstream f("text.in");
ofstream g("text.out");
char sep[]=" ,!;-123456789/?.*()_";
while(!f.eof())
{
f>>a;
p=strtok(a,sep);
while(p)
{
n++;
m+=strlen(p);
p=strtok(NULL,sep);
}
}
g<<m/n;
return 0;
}