Cod sursa(job #805759)
Utilizator | Data | 1 noiembrie 2012 08:52:28 | |
---|---|---|---|
Problema | Text | Scor | 40 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.29 kb |
#include<fstream>
#include<string.h>
using namespace std;
ifstream fin("text.in");
ofstream fout("text.out");
char s[1048576],*p;
int l,n;
int main(){
fin.get(s,1048576);
p=strtok(s,"-, ;:.!?");
while(p)
{
n++;
l=l+strlen(p);
p=strtok(NULL,"-, ;:.!?");
}
fout<<l/n;
return 0;
}