Pagini recente » Cod sursa (job #876323) | Cod sursa (job #3245580) | Cod sursa (job #2647900) | Cod sursa (job #1150350) | Cod sursa (job #757902)
Cod sursa(job #757902)
#include <fstream>
#include <string.h>
using namespace std;
char Data[1000005];
int main(void)
{
fstream fin("text.in",ios::in);
fstream fout("text.out",ios::out);
long Count = 0;
long Len = 0;
long P = 0;
long L = 0;
while (fin >> Data)
{
Count += 1;
L = strlen(Data);
for (P = 0;P < L;P += 1)
{
if (((Data[P] >= 'a') && (Data[P] <= 'z')) ||
((Data[P] >= 'A') && (Data[P] <= 'Z')))
{
Len += 1;
}
}
}
fout << (Len / Count);
fin.close();
fout.close();
return 0;
}