Cod sursa(job #689804)
Utilizator | Data | 24 februarie 2012 20:52:09 | |
---|---|---|---|
Problema | Text | Scor | 40 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.29 kb |
#include<fstream>
#include<string.h>
using namespace std;
char a[100000],*p,sep[]=" ,.:!()?><;&%#-@/'\+-*=_";
int main()
{ifstream f("text.in");
ofstream g("text.out");
f.getline(a,100000);
int n=0,s=0;
p=strtok(a,sep);
while(p)
{s=s+strlen(p);
n++;
p=strtok(NULL,sep);}
g<<s/n;}