Cod sursa(job #1199389)
Utilizator | Data | 19 iunie 2014 11:19:24 | |
---|---|---|---|
Problema | Text | Scor | 40 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.38 kb |
#include <fstream>
#include <cstring>
using namespace std;
ifstream fin("text.in");
ofstream fout("text.out");
int nr,s;
char c[1000001],*p,sep[]=" .,:;-_=!+\?@#$%^&*()][|/><123456789~";
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;
}