Pagini recente » Cod sursa (job #1696430) | Cod sursa (job #2133311) | Cod sursa (job #3311805) | Cod sursa (job #2267617) | Cod sursa (job #3323075)
#include <bits/stdc++.h>
using namespace std;
ifstream fin("text.in");
ofstream fout("text.out");
char ch;
int x, nrch, cuv;
int Litera(char ch)
{
if (ch >= 'A' && ch <= 'Z') return 1;
if (ch >= 'a' && ch <= 'z') return 1;
return 0;
}
int main()
{
while (fin.get(ch))
if (Litera(ch) == 1)
x++;
else if (x > 0)
{
nrch += x;
cuv++;
x = 0;
}
if (x > 0)
{
nrch += x;
cuv++;
}
if (cuv == 0) fout << "0\n";
else fout << nrch / cuv << "\n";
return 0;
}