Pagini recente » Cod sursa (job #2193340) | Istoria paginii utilizator/feraru_andreea_simona_325cb | Cod sursa (job #404433) | Profil yana25 | Cod sursa (job #1283584)
#include <fstream>
#include <cstring>
using namespace std;
ifstream f("text.in");
ofstream g("text.out");
char x;
int cv,li;
bool ok;
int main()
{
while(f.get(x))
{
if(ok==false)
{
if((x>='a'&&x<='z')||(x>='A'&&x<='B'))
ok = true;
}
if(ok == true)
{
if((x>='a'&&x<='z')||(x>='A'&&x<='B'))
li++;
else
{
cv++;
ok=0;
}
}
}
g<<li/cv<<'\n';
f.close();
g.close();
return 0;
}