Cod sursa(job #860679)
Utilizator | Data | 20 ianuarie 2013 16:46:22 | |
---|---|---|---|
Problema | Text | Scor | 40 |
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("text.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;
}