Pagini recente » Cod sursa (job #2679428) | Cod sursa (job #974755) | Cod sursa (job #1848176) | Cod sursa (job #33525) | Cod sursa (job #2212636)
#include <fstream>
using namespace std;
ifstream fin("text.in");
ofstream fout("text.out");
int main()
{
int cnt = 0, ok = 0, cuvinte = 0;
char a;
while (fin >> noskipws >> a)
{
if ((a >= 'A' && a <= 'Z') || (a >= 'a' && a <= 'z'))
{
cnt++;
ok = 1;
}
else
{
if (ok == 1)
{
cuvinte++;
ok = 0;
}
}
}
if (ok == 1)
{
cuvinte++;
}
fout << cnt / cuvinte;
return 0;
}