Pagini recente » Cod sursa (job #456898) | Cod sursa (job #460669) | Cod sursa (job #911347) | Cod sursa (job #737872) | Cod sursa (job #1123531)
#include <fstream>
#define DEBUG 0
#if DEBUG
#include <iostream>
#endif
using namespace std;
int main()
{
ifstream in("text.in");
ofstream out("text.out");
int l = 0, c = 0;
char t;
bool swL = false;
while (in.get(t))
{
#if DEBUG
cout << "t(" << t << ") ";
#endif
if (!swL && ((t>='a'&&t<='z')||(t>='A'&&t<='Z')))
{
swL = 1;
}
if (swL)
{
if (((t>='a'&&t<='z')||(t>='A'&&t<='Z'))) ++l;
else
{
++c;
swL = 0;
}
}
}
#if DEBUG
cout << l/c;
#endif
out << l/c;
return 0;
}