Cod sursa(job #444851)
Utilizator | Data | 21 aprilie 2010 21:26:45 | |
---|---|---|---|
Problema | Text | Scor | 50 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.37 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;
}