Pagini recente » Monitorul de evaluare | Cod sursa (job #2765705) | Cod sursa (job #1845484) | Cod sursa (job #273871) | Cod sursa (job #1507757)
#include <iostream>
#include <fstream>
using namespace std;
int main()
{
int nrlitere=0 , nrcuvinte=0;
char x;
ifstream f("text.in");
ofstream g("text.out");
while(f.get(x))
{
while((!((x>='a'&&x<='z')||(x>='A'&&x<='Z')))&&!f.eof())
f.get(x);
if((x>='a'&&x<='z')||(x>='A'&&x<='Z'))
nrcuvinte++;
while(((x>='a'&&x<='z')||(x>='A'&&x<='Z'))&&!f.eof())
{
nrlitere++;
f.get(x);
}
}
g<<nrlitere/nrcuvinte;
return 0;
}