Cod sursa(job #807576)
| Utilizator | Data | 4 noiembrie 2012 22:50:21 | |
|---|---|---|---|
| Problema | Text | Scor | 40 |
| Compilator | cpp | Status | done |
| Runda | Arhiva de probleme | Marime | 0.35 kb |
using namespace std;
#include<fstream>
#include<ctype.h>
#include<string.h>
ifstream eu("text.in");
ofstream tu("text.out");
int main()
{
char x[10000],sep[]=" ,:;!?-\n.()%^&*@~/-+=|";
char *p;
int s=0,k=0,S;
eu.get(x,10000);
p=strtok(x,sep);
while(p)
{
s=s+strlen(p);
k++;
p=strtok(NULL,sep);
}
S=s/k;
tu<<S;
return 0;
}
