Cod sursa(job #2414147)

Utilizator StefanSanStanescu Stefan StefanSan Data 24 aprilie 2019 11:15:49
Problema Text Scor 0
Compilator cpp-64 Status done
Runda Arhiva de probleme Marime 0.59 kb
#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);

}