Cod sursa(job #561923)

Utilizator LenishLeana Cristian Antoniu Lenish Data 21 martie 2011 22:49:02
Problema Text Scor 40
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.42 kb
#include<fstream>
#include<iostream>
#include<cstring>
using namespace std;
int main ()
{char c[111111],*p;
 int c1=0,c2=0;
 ifstream f("text.in");
 ofstream g("text.out");
 f.get(c,1111110);
 p=strtok(c,". ,\n-!?:;1234567890/\\@#$%^&*()_=+{}'<`~>");
 while(p!=NULL)
 {c1=c1+strlen(p);
  c2++;
  p=strtok(NULL,". ,\n-!?:;1234567890/\\@#$%^&*()_=+{}'<`~>");
 }
g<<c1/c2;
f.close();
g.close();
return 0;
}