Cod sursa(job #1152485)
Utilizator | Data | 24 martie 2014 19:19:53 | |
---|---|---|---|
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[10001],*p,sep[]=" .,:;-_'=!?@#$%^&*()][|/><";
int main()
{
fin.get(c,10000);
p=strtok(c,sep);
while(p!=NULL)
{
s+=strlen(p);
nr++;
p=strtok(NULL,sep);
}
fout<<s/nr;
return 0;
}