Cod sursa(job #805804)
Utilizator | Data | 1 noiembrie 2012 10:33:01 | |
---|---|---|---|
Problema | Text | Scor | 40 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.35 kb |
#include <fstream>
#include <string.h>
using namespace std;
ifstream f("text.in");
ofstream g("text.out");
char text[1048577],*p,*q,sep[]="-,:|\/.;'!? ";
int media,l,nr;
int main ()
{
f.get(text,1048577);
p=strtok(text,sep);
while(p)
{
for(q=p;*q;q++)
l++;
nr++;
p=strtok(NULL,sep);
}
media=l/nr;
g<<media;
return 0;
}