Cod sursa(job #1554766)
Utilizator | Data | 21 decembrie 2015 18:39:49 | |
---|---|---|---|
Problema | Text | Scor | 10 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.34 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;
}