Pagini recente » Cod sursa (job #295823) | Cod sursa (job #2422896) | Cod sursa (job #2088763) | Cod sursa (job #2435387) | Cod sursa (job #3030400)
#include <fstream>
using namespace std;
ifstream cin("text.in");
ofstream cout("text.out");
char x;
int cate = 0, cnt = 0;
bool litera(char c)
{
if (c >= 'a' && c <= 'z' )
return true;
if ( c >= 'A' && c <= 'Z' )
return true;
return false;
}
int main()
{
cin.get(x);
while (x != EOF && x != '\n')
{
if ( litera(x) == true )
{
while ( litera(x) == true && x != EOF && x != '\n' )
{
++cate;
cin.get(x);
}
++cnt;
}
cin.get(x);
}
cout << cate / cnt << endl;
return 0;
}