Cod sursa(job #261015)
Utilizator | Data | 17 februarie 2009 20:08:51 | |
---|---|---|---|
Problema | Text | Scor | 40 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.32 kb |
#include<fstream.h>
#include<string.h>
char *p,a[3000],b[50]=" -![]{}()*&^%$#@!~`|';:<>/?";
long s=0,c=0;
int main()
{
b[0]=(char)92;
ifstream f("text.in");
ofstream g("text.out");
f.get(a,3000);
f.get();
p=strtok(a,b);
while(p)
{
s+=strlen(p);
c++;
p=strtok(NULL,b);
}
s=s/c;
g<<s;
return 0;
}