Pagini recente » Cod sursa (job #2683571) | Cod sursa (job #2059176) | Cod sursa (job #3254556) | Cod sursa (job #1801897) | Cod sursa (job #2297337)
#include <fstream>
#include <cstring>
using namespace std;
ifstream fin("text.in");
ofstream fout("text.out");
int n,s;
int main()
{int i;
bool ok = 0;
char c,t;
while(fin.get(c))
{if(( c>= 'a' && c <= 'z') || (c >='A' && c <='Z'))
{s++;
if(!isalpha(t) && ok)
{n++;
ok = 0;
}
}
else
{t = c;
ok = 1;
}
}
fout<<s/n;
fin.close();
fout.close();
return 0;
}