Cod sursa(job #444879)

Utilizator lily3Moldovan Liliana lily3 Data 21 aprilie 2010 22:54:42
Problema Text Scor 70
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.36 kb
#include<fstream>
using namespace std;
 
char a[257],*p,x;
long i,n,m,ok=0;
int main()
{
    ifstream f("text.in");
    ofstream g("text.out");
   char sep[]=" ,!;-";
   while(!f.eof())
   {
        f>>a;
   p=strtok(a,sep);
    while(p)
    {
        n++;
        m+=strlen(p);
        p=strtok(NULL,sep);
    }
   }
    g<<m/n;
    return 0;
}