Pagini recente » Cod sursa (job #11950) | Cod sursa (job #1606791) | Cod sursa (job #551242) | Cod sursa (job #513083) | Cod sursa (job #9238)
Cod sursa(job #9238)
#include<fstream.h>
#include<math.h>
int main()
{
char c;
long x=0,cv=0;
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++;
else
{ if (c==' ')
{
char g;
fin.get(g);
if ((((int)g>=97)&&((int)g<=122)) || (((int)g>=65) && ((int)g<=90)))
{cv++; x++;}
}
}
}
}while(!fin.eof());
fin.close();
cv++;
fout<<floor(x/cv);
fout.close();
return 0;
}