Pagini recente » Cod sursa (job #671940) | Cod sursa (job #903043) | Cod sursa (job #1292960) | Statistici Preda Stefan-Alexandru (Preda_Stefan_Alexandru_325CC) | Cod sursa (job #2706698)
#include<iostream>
#include<fstream>
#include<cstring>
using namespace std;
int main()
{
char c;
ifstream fin("text.in");
ofstream fout("text.out");
long long int cnt = 0, s = 0, nr = 0;
while(fin.get(c))
{
if(c >= 'A' && c <= 'Z' || c >= 'a' && c <= 'z')
{
cnt++;
}
else
{
if(cnt)
{
nr++;
s += cnt;
}
cnt = 0;
}
}
fout << s / nr;
return 0;
}