Cod sursa(job #11519)
Utilizator | Data | 31 ianuarie 2007 20:02:27 | |
---|---|---|---|
Problema | Text | Scor | 30 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.44 kb |
#include<stdio.h>
#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;
while( !fin.eof() )
{
fin.getline(a,1000);
b="\|?/>.<,':;}]{[+= _-)(*&^%$#@!~`";
c=strtok(a,b);
while(c)
{
s++;
n=n+strlen(c);
c=strtok(NULL,b);
}
}
ofstream fout(output);
fout<<n/s;
return 0;
}