Cod sursa(job #1554770)
Utilizator | Data | 21 decembrie 2015 18:44:35 | |
---|---|---|---|
Problema | Text | Scor | 0 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.36 kb |
#include <fstream>
#include <cstring>
using namespace std;
ifstream f("text.in");
ofstream g("text.out");
char s[1200000],*p;
int l=0,nr=0;
int main ()
{
f>>s;
p=strtok(s," -!?,.;:/'/"");
while (p!=NULL)
{
nr++;
l=l+strlen(p);
p=strtok(NULL," -!?,.;:/'/"");
}
g<<l/nr;
g.close();
return 0;
}