Cod sursa(job #78686)
| Utilizator | Data | 19 august 2007 00:43:41 | |
|---|---|---|---|
| Problema | Text | Scor | 0 |
| Compilator | cpp | Status | done |
| Runda | Arhiva de probleme | Marime | 0.53 kb |
#include <fstream.h>
3include <string.h>
int main()
{
char linie[1025];
char str[1028];
char * tok;
char delim="`1234567890-=+_)(*&^%$#@!~<>?:\"{}|\\][;'/.,";
int lcuv, cuv;
ifstream fin("text.in");
ofstream fout("text.out");
fin.get(linie,1028);
strcpy(str,"a"); strcat(str,linie);
cuv=lcuv=0;
tok=strtok(str,delim);lcuv+=strlen(tok);
cuv++;
while(tok != NULL)
{
tok=strtok(NULL,delim);
lcuv+=strlen(tok);
cuv++;
}
lcuv--;
fout<<lcuv/cuv;
fin.close();fout.close();
return 0;
}
