Cod sursa(job #1554774)
Utilizator | Data | 21 decembrie 2015 18:46:19 | |
---|---|---|---|
Problema | Text | Scor | 40 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.37 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.get(s,1200000);
p=strtok(s," -!?,.;:\'\"");
while (p!=NULL)
{
nr++;
l=l+strlen(p);
p=strtok(NULL," -!?,.;:\'\"");
}
g<<l/nr;
g.close();
return 0;
}