Cod sursa(job #2276315)
| Utilizator | Data | 4 noiembrie 2018 16:25:07 | |
|---|---|---|---|
| Problema | Text | Scor | 0 |
| Compilator | cpp-64 | Status | done |
| Runda | Arhiva de probleme | Marime | 0.6 kb |
#include <iostream>
#include <fstream>
#include <string.h>
using namespace std;
ifstream intrare("text.in");
ofstream iesire("text.out");
int main()
{
int nr=1,i;
const long int NMAX=1000000;
char sir[NMAX];
char *p,cuv[10000][100];
char del[7]= {',',' ','.','!','?','-','/'};
long long int s=0;
intrare.get();
intrare.get(sir,NMAX);
p=strtok(sir,del);
while(p!=NULL)
{
strcpy(cuv[nr],p);
nr++;
s+=strlen(p);
p=strtok(NULL,del);
}
iesire<<s/(nr-1);
return 0;
}
