Pagini recente » Cod sursa (job #2937570) | Cod sursa (job #1322262) | Cod sursa (job #846685) | Borderou de evaluare (job #2649399) | Cod sursa (job #2297308)
#include <fstream>
#include <cstring>
using namespace std;
ifstream fin("text.in");
ofstream fout("text.out");
int n,s;
int main()
{int i,w = 0;
bool ok = 0;
char c,t[100000];
while(fin.get(c))
{if(isalpha(c))
{s++;
if(!isalpha(t[w]) && ok)
{n++;
w = 0;
ok = 0;
}
}
else
{t[++w] = c;
ok = 1;
}
}
fout<<s/n;
fin.close();
fout.close();
return 0;
}