Cod sursa(job #832080)
| Utilizator | Data | 9 decembrie 2012 20:21:58 | |
|---|---|---|---|
| Problema | Text | Scor | 40 |
| Compilator | cpp | Status | done |
| Runda | Arhiva de probleme | Marime | 0.45 kb |
#include <iostream>
#include <fstream>
#include <cstring>
using namespace std;
char sep[]="`~!@#$%^&*()_-+=[{]};:'|\<,>./?|\ """;
char text[6000000],*p;
ifstream in("text.in");
ofstream out("text.out");
int main()
{
unsigned long long nr_cuv=0, lg=0;
in.getline(text,6000000);
p=strtok(text,sep);
while(p!=NULL)
{
lg+=strlen(p);
nr_cuv++;
p=strtok(0,sep);
}
out<<lg/nr_cuv;
return 0;
}
