Pagini recente » Cod sursa (job #2500871) | Cod sursa (job #624760) | Cod sursa (job #3243241) | Cod sursa (job #2138680) | Cod sursa (job #1190036)
#include <fstream>
#include <cstring>
#define Nmax 10000005
using namespace std;
ifstream f("text.in");
ofstream g("text.out");
char a[Nmax];
int lg,cont,lit,i;
int main()
{f.getline(a,Nmax);
lg=strlen(a);
for (i=0;i<lg;i++)
{ if ((a[i]>='a' && a[i]<='z') || (a[i]>='A' && a[i]<='Z'))
{cont++;
while ((a[i]>='a' && a[i]<='z') || (a[i]>='A' && a[i]<='Z'))
{lit++; i++;};
i--;
}
}
g<<lit/cont<<'\n';
f.close();
g.close();
return 0;
}