Cod sursa(job #2046954)
| Utilizator | Data | 24 octombrie 2017 12:40:34 | |
|---|---|---|---|
| Problema | Text | Scor | 30 |
| Compilator | cpp | Status | done |
| Runda | Arhiva de probleme | Marime | 0.52 kb |
#include <iostream>
#include <fstream>
#include <cstring>
using namespace std;
fstream fin("text.in", ios::in);
fstream fout("text.out", ios::out);
int main()
{
char text[105], *p, a[105][20];
int nrCuv=0,nrLit,suma=0;
fin.get(text, 100);
p=strtok(text, " ,.!?-;:'()_+=""");
while(p) {
strcpy(a[nrCuv],p);
for(nrLit=0; a[nrCuv][nrLit]; nrLit++);
p=strtok(NULL," ,.!?-;""()_+=:'");
nrCuv++;
suma+=nrLit;
}
fout<<suma/nrCuv;
return 0;
}
