Cod sursa(job #78696)
Utilizator | Cristian Dinu Dr.Optix | Data | 19 august 2007 00:55:52 |
---|---|---|---|
Problema | Text | Scor | 0 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.47 kb |
#include <fstream.h>
#include <string.h>
int main()
{
char linie[1029];
char * tok;
char delim[]="`1234567890-=+_)(*&^%$#@!~<>?:\"{}|][;'/.,";
int lcuv, cuv;
ifstream fin("text.in");
ofstream fout("text.out");
fin.getline(linie,1029);
cuv=lcuv=0;
tok=strtok(linie,delim);lcuv+=strlen(tok);
cuv++;
while(tok != NULL)
{
tok=strtok(NULL,delim);
lcuv+=strlen(tok);
cuv++;
}
fout<<(lcuv/cuv);
fin.close();fout.close();
return 0;
}