Pagini recente » Profil M@2Te4i | Cod sursa (job #3202045) | Clasament dupa rating | Cod sursa (job #1962753) | Cod sursa (job #2016398)
#include <fstream>
using namespace std;
ifstream fin ("text.in");
ofstream fout ("text.out");
char X[1100000];
int NrCuvinte, NrLitere, i;
int main()
{
while(fin.getline (X, 1100000))
{
for (i=0; X[i]!=0; i++)
{
if (('a'<=X[i] and X[i]<='z') or ('A'<=X[i] and X[i]<='Z'))
{
NrCuvinte++;
while (('a'<=X[i] and X[i]<='z') or ('A'<=X[i] and X[i]<='Z'))
{
NrLitere++;
++i;
}
i--;
}
}
}
fout<<NrLitere/NrCuvinte<<"\n";
return 0;
}