Cod sursa(job #9243)
Utilizator | Data | 27 ianuarie 2007 12:19:59 | |
---|---|---|---|
Problema | Text | Scor | 80 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.54 kb |
#include<fstream.h>
#include<math.h>
int main()
{
char c;
long x=0,cv=0,g=1;
ifstream fin("text.in");
ofstream fout("text.out");
do{
fin.get(c);
if(!fin.eof())
{
if((((int)c>=97)&&((int)c<=122)) || (((int)c>=65) && ((int)c<=90)))
{ x++; g=0; }
else
{ if ((c!='-') && (g==0))
{
cv++; g=1;
}
}
}
}while(!fin.eof());
fin.close();
cv++;
fout<<floor(x/cv);
fout.close();
return 0;
}