Pagini recente » Cod sursa (job #489044) | Cod sursa (job #386162) | Cod sursa (job #901002) | Cod sursa (job #902182) | Cod sursa (job #2455697)
#include <fstream>
using namespace std;
char x;
int nrcuv, nrlit, unrlit;
ifstream f("text.in");
ofstream g("text.out");
int isLetter(char x)
{
if(x>='a' && x<='z' || x>='A' && x<='Z')
return 1;
return 0;
}
int main()
{
while(!f.eof())
{
x=f.get();
if(isLetter(x))
{
nrlit++;
}
else
{
if(unrlit != nrlit)
{
nrcuv++;
unrlit=nrlit;
}
}
}
if(unrlit != nrlit)
{
nrcuv++;
unrlit=nrlit;
}
g<<nrlit/nrcuv;
return 0;
}