Pagini recente » Cod sursa (job #1986870) | Cod sursa (job #384148) | Cod sursa (job #394091) | Statistici Drumus Horia (fuxster) | Cod sursa (job #603397)
Cod sursa(job #603397)
#include <iostream>
#include <fstream>
using namespace std;
int main()
{
ifstream in("text.in");
char c;
int k=0, l=0;
bool ok=false, ok1=false;
for(;in && !in.eof() && in >> noskipws >> c;)
{
if(isalpha(c)) ++l, ok=true;
else ok=false;
if(ok != ok1 && ok) ++k;
ok1 = ok;
}
ofstream out("text.out");
out << (l/k);
return 0;
}