Cod sursa(job #808845)
Utilizator | Data | 7 noiembrie 2012 15:10:13 | |
---|---|---|---|
Problema | Text | Scor | 40 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.36 kb |
using namespace std;
#include<fstream>
#include<ctype.h>
#include<string.h>
ifstream eu("text.in");
ofstream tu("text.out");
int main()
{
char x[250000],sep[]=" ,:;!?-\n.()%^&*@~/-+=|><";
char *p;
int s=0,k=0,S,i;
eu.get(x,250000);
p=strtok(x,sep);
while(p)
{
s=s+strlen(p);
k++;
p=strtok(NULL,sep);
}
S=s/k;
tu<<S;
return 0;
}