Cod sursa(job #1494759)
| Utilizator | Data | 1 octombrie 2015 20:54:39 | |
|---|---|---|---|
| Problema | Text | Scor | 40 |
| Compilator | cpp | Status | done |
| Runda | Arhiva de probleme | Marime | 0.59 kb |
#include <cstdio>
#include <cstring>
using namespace std;
char s[10000100];
int main() {
freopen("text.in", "r", stdin);
freopen("text.out", "w", stdout);
int n = 0, let = 0, N;
bool cuvon = false;
gets(s);
N = strlen(s);
s[N] = '*';
for(int i = 0; i <= N; ++ i) {
if((s[i] >= 'A' && s[i] <= 'Z')||(s[i] >= 'a' && s[i] <= 'z')) {
++ let;
cuvon = true;
} else {
if(cuvon) {
cuvon = false;
++ n;
}
}
}
printf("%d", let / n);
return 0;
}