Cod sursa(job #33702)

Utilizator bacerandreiBacer Andrei bacerandrei Data 19 martie 2007 18:22:44
Problema Text Scor 0
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.39 kb
#include<string.h>
#include<fstream.h>
char sir[1000000],sep[]=" 123456789~@#$%^&\,-?!;:.'][{}_/)(=+-*|",*p;
long int nr=0,n1,s;
int main()
{
  ifstream f("text.in");
  ofstream g("text.out");
  f.get(sir,1000000);
   f.close();
  p=strtok(sir,sep);
  while(p)
  {
    n1=strlen(p);
    nr++;
    p=strtok(NULL,sep);
    s+=n1;
  }
  g<<s/nr;
  g.close();
  return 0;

}