Pagini recente » Cod sursa (job #1372665) | Cod sursa (job #1226486) | Cod sursa (job #1668565) | Cod sursa (job #2895785) | Cod sursa (job #2562894)
#include <bits/stdc++.h>
using namespace std;
ifstream fin("text.in");
ofstream fout("text.out");
char a[10000000];
int main()
{
int i;
fin.getline(a, 10000000);
int ltot = 0, nrcuv = 0;
for(i = 0;a[i];)
{
if((a[i] <= 'z' && a[i] >= 'a') || (a[i] <= 'Z' && a[i] >= 'A'))
{
int x = 0;
nrcuv++;
while ((a[i] <= 'z' && a[i] >= 'a') || (a[i] <= 'Z' && a[i] >= 'A'))
{
i++;
x++;
}
ltot += x;
}
else
i++;
}
fout << ltot / nrcuv;
return 0;
}