Cod sursa(job #1986616)
Utilizator | Data | 28 mai 2017 19:05:52 | |
---|---|---|---|
Problema | Text | Scor | 0 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.41 kb |
#include <iostream>
#include <fstream>
#include <string.h>
using namespace std;
ifstream f("text.in");
ofstream g("text.out");
int main()
{
char t[10000000000000000],* p,sep[]=" ;:',.?";
long nr=0,s=0;
f.get(t,10000000000000000);
p=strtok(t,sep);
while(p!=NULL)
{
nr++;
s+=strlen(p);
p=strtok(NULL,sep);
}
g<<(long)s/nr<<'\n';
return 0;
}