Cod sursa(job #1127872)
| Utilizator | Data | 27 februarie 2014 14:08:41 | |
|---|---|---|---|
| Problema | Text | Scor | 50 |
| Compilator | cpp | Status | done |
| Runda | Arhiva de probleme | Marime | 0.53 kb |
using namespace std;
#include <fstream>
#include <string.h>
ifstream fin("text.in");
ofstream fout("text.out");
#define Nmax 10000
int main()
{
int nrcuv=0, lg=0;
char *p, *q;
char sep[]="0123456789 !@.,-_\/*+";
char sir[Nmax+1];
fin.getline(sir, Nmax+1);
p=strtok(sir, sep);
do
{
nrcuv++; q=p;
while(q && ((*q>='a' && *q<='z') || (*q>='A' && *q<='Z'))) q++;
lg+=q-p;
p=strtok(NULL, sep);
}
while(p);
fout<<lg/nrcuv;
return 0;
}
