Pagini recente » Cod sursa (job #709430) | Cod sursa (job #617826) | Cod sursa (job #2952252) | Cod sursa (job #638833) | Cod sursa (job #2316162)
#include <iostream>
#include <cstring>
#include <fstream>
using namespace std;
ifstream fin("text.in");
ofstream fout("text.out");
bool Litera(char x)
{
if((x >='a' && x <= 'z') || (x >='A' && x <= 'Z'))
return 1;
return 0;
}
int main()
{
int i,nrcuv,nr;
nrcuv = nr = 0;
char x, y;
while(fin.get(x))
{
if(Litera(x))
{
nr++;
}
if(!Litera(x) && Litera(y) )
nrcuv++;
y = x;
}
fout << nr/nrcuv << "\n";
return 0;
}