Cod sursa(job #860673)

Utilizator alexsuciuAlex Suciu alexsuciu Data 20 ianuarie 2013 16:39:59
Problema Text Scor 0
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.39 kb
#include<fstream>
#include<cstring>
#include<iostream>
using namespace std;
long n=0,lung;
char s[10000],sep[]=",.?;:'+=)(*&^%$#@!/><1234567890- }{[]_",*p,v[10000][100];
int main()
{
    ifstream f("text.in");
    ofstream g("texti.out");
    f.getline (s,10000);
    p=strtok(s,sep);
while(p)
{n++;
strcpy(v[n],p);
p=strtok(NULL,sep);
lung=lung+strlen(v[n]);
}
g<<lung/n;
}