Pagini recente » Cod sursa (job #1736148) | Cod sursa (job #2093090) | Cod sursa (job #2315427) | Cod sursa (job #784080) | Cod sursa (job #2414147)
#include <iostream>
#include <algorithm>
#include <string>
#include <cmath>
#include <string.h>
#include <fstream>
using namespace std;
char c;
int nr = 1, nrr = 0;
int main() {
freopen("text.in", "r", stdin);
freopen("text.out", "w", stdout);
bool ok = false;
c = fgetc(stdin);
while (!feof(stdin)) {
int sr = c;
if ((sr <= 89 && sr >= 65) || (sr <= 122 && sr >= 97) || (sr <= 57 && sr >= 48)) {
nrr++;
ok = true;
}
if (sr == 32 || sr == 45) {
if (ok == true) {
nr++;
ok = false;
}
}
}
printf("%d", nrr / nr);
}