Cod sursa(job #390594)
| Utilizator | Data | 4 februarie 2010 01:11:51 | |
|---|---|---|---|
| Problema | Text | Scor | 0 |
| Compilator | cpp | Status | done |
| Runda | Arhiva de probleme | Marime | 0.39 kb |
# include <fstream>
# include <cstring>
using namespace std;
int main ()
{
int nrc=0, l=0, lc;
char c[1000], sep[]="~`!()_-+=><.,?/|\'\";:", *p;
ifstream fin ("text.in");
ofstream fout ("text.out");
while (fin>>c)
{
p=strtok(c, sep);
while (p)
{
lc=strlen(p);
if (lc)nrc++, l+=lc;
p=strtok(NULL, sep);
}
}
fout<<l<<" "<<nrc<<endl<<l/nrc;
return 0;
}
