Cod sursa(job #390682)
Utilizator | Data | 4 februarie 2010 12:49:50 | |
---|---|---|---|
Problema | Text | Scor | 40 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.3 kb |
#include<fstream.h>
#include<string.h>
int main()
{
int k=0,s=0;
char a[999],*p,sep[]="`~1234567890-=\',./<>? ";
ifstream fin("text.in");
ofstream fout("text.out");
fin.get(a,999);
p=strtok(a,sep);
while(p!=NULL)
{
k++;
s+=strlen(p);
p=strtok(NULL,sep);
}
fout<<s/k;
return 0;
}