Cod sursa(job #2002095)
| Utilizator | Data | 18 iulie 2017 17:03:01 | |
|---|---|---|---|
| Problema | Text | Scor | 40 |
| Compilator | cpp | Status | done |
| Runda | Arhiva de probleme | Marime | 0.53 kb |
#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);
scanf("%c", &ch);
while(ch != EOF && ch != '\n') {
if(isalpha(ch)) {
++nrcuv;
while(isalpha(ch)) {
scanf("%c", &ch);
++nrlit;
}
}
else {
scanf("%c", &ch);
}
}
printf("%d\n", nrlit / nrcuv);
return 0;
}
