Cod sursa(job #808854)
| Utilizator | Data | 7 noiembrie 2012 15:23:54 | |
|---|---|---|---|
| Problema | Text | Scor | 40 |
| Compilator | cpp | Status | done |
| Runda | Arhiva de probleme | Marime | 0.4 kb |
using namespace std;
#include<fstream>
#include<ctype.h>
#include<string.h>
ifstream eu("text.in");
ofstream tu("text.out");
int main()
{
char x[1048580],sep[]=" '[],:;!?-\n.()%^&*@~/-+=|><`\b\t_{}\\0123456789";
char *p;
int s=0,k=0,S,i;
eu.get(x,1048580);
p=strtok(x,sep);
while(p)
{
s=s+strlen(p);
k++;
p=strtok(NULL,sep);
}
if(k)S=s/k;
else S=0;
tu<<S;
return 0;
}
