Pagini recente » Cod sursa (job #1238829) | Cod sursa (job #2637846) | Cod sursa (job #1830187) | Cod sursa (job #2080665) | Cod sursa (job #2562892)
#include <bits/stdc++.h>
using namespace std;
ifstream fin("text.in");
ofstream fout("text.out");
char a[1000000];
int main()
{
int i;
fin.getline(a, 1000000);
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;
}