Pagini recente » Cod sursa (job #2817683) | Cod sursa (job #2220510) | Cod sursa (job #1542383) | Cod sursa (job #537956) | Cod sursa (job #3030394)
#include <fstream>
using namespace std;
ifstream cin("text.in");
ofstream cout("text.out");
bool litera(char x)
{
if (x >= 'a' && x <= 'z' )
return true;
if ( x >= 'A' && x <= 'Z' )
return true;
return false;
}
int main()
{
char x;
int cate = 0, cnt = 0;
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;
}