Cod sursa(job #1152490)
Utilizator | Data | 24 martie 2014 19:22:09 | |
---|---|---|---|
Problema | Text | Scor | 40 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.37 kb |
#include <fstream>
#include <cstring>
using namespace std;
ifstream fin("text.in");
ofstream fout("text.out");
int nr,s;
char c[1000001],*p,sep[]=" .,:;-_'=!?@#$%^&*()][|/><";
int main()
{
fin.get(c,1000000);
p=strtok(c,sep);
while(p!=NULL)
{
s+=strlen(p);
nr++;
p=strtok(NULL,sep);
}
fout<<s/nr;
return 0;
}