Cod sursa(job #757902)
Utilizator | Grigorita Vlad-Stefan Xladhenian | Data | 13 iunie 2012 18:53:14 |
---|---|---|---|
Problema | Text | Scor | 70 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.55 kb |
#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;
}