Cod sursa(job #561463)
| Utilizator | Data | 20 martie 2011 14:51:38 | |
|---|---|---|---|
| Problema | Text | Scor | 100 |
| Compilator | cpp | Status | done |
| Runda | Arhiva de probleme | Marime | 0.46 kb |
#include <fstream>
#include <string.h>
using namespace std;
ifstream fin("text.in");
ofstream fout("text.out");
int main(){
char *s,sep[]=". ,\n-!?:;1234567890/\\@#$%^&*()_=+{}'<`~>",*t;
long long nrw=0, len=0;
s=new char [1111111111];
fin.getline(s,1111111110,EOF);
t=strtok(s,sep);
while (t!=NULL){
nrw++;
len+=strlen(t);
t=strtok(NULL,sep);
}
fout<<(long long)(len/nrw);
delete [] s;
fin.close();
fout.close();
return 0;
}
