Pagini recente » Cod sursa (job #244473) | Cod sursa (job #115683) | Cod sursa (job #682865) | Cod sursa (job #1900196) | 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;
}