Pagini recente » Cod sursa (job #3193048) | Cod sursa (job #2003698) | Monitorul de evaluare | Profil 6gabriellae7722wM7 | Cod sursa (job #2002096)
#include <cstdio>
#include <cctype>
using namespace std;
int main()
{
char ch;
int nrlit = 0, nrcuv = 0;
freopen("text.in","r",stdin);
freopen("text.out","w",stdout);
ch = fgetc(stdin);
while(ch != EOF) {
if(isalpha(ch)) {
++nrcuv;
while(isalpha(ch)) {
ch = fgetc(stdin);
++nrlit;
}
}
else {
ch = fgetc(stdin);
}
}
printf("%d\n", nrlit / nrcuv);
return 0;
}