Pagini recente » Cod sursa (job #2665656) | Cod sursa (job #2484628) | Cod sursa (job #2755764) | Cod sursa (job #2871640) | Cod sursa (job #1513835)
#include <iostream>
#include <fstream>
using namespace std;
int main()
{
int x,OK=0,length = 0,nr=0;
char character;
fstream f("text.in");
ofstream g("text.out");
while(!f.eof()){
f.get(character);
if(((character >= 'A')&&(character<='Z'))||((character >= 'a')&&(character<='z'))){
OK = 1;
length++;
}
else if((OK==1)){
nr++;
OK = 0;
}
}
length = length/nr;
g<<length;
return 0;
}