Cod sursa(job #11541)
Utilizator | HighScore skyel | Data | 31 ianuarie 2007 20:47:21 |
---|---|---|---|
Problema | Text | Scor | 40 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.43 kb |
#include<fstream.h>
#include<string.h>
#define input "text.in"
#define output "text.out"
int main()
{
ifstream fin(input);
char a[1000];
char *b,*c;
int s,n;
s=0;
b="\|?/>.<,':;}]{[+= _-)(*&^%$#@!~`0123456789";
while( !fin.eof() )
{
fin.getline(a,1000);
c=strtok(a,b);
while(c)
{
s++;
n=n+strlen(c);
c=strtok(NULL,b);
}
}
ofstream fout(output);
fout<<n/s;
return 0;
}