Cod sursa(job #3030386)
Utilizator | Andrei Mircea Andrei1209 | Data | 17 martie 2023 17:25:51 |
---|---|---|---|
Problema | Text | Scor | 50 |
Compilator | cpp-64 | Status | done |
Runda | Arhiva de probleme | Marime | 0.63 kb |
#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 )
{
++cate;
cin.get(x);
}
++cnt;
}
cin.get(x);
}
cout << cate / cnt << endl;
return 0;
}