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