Cod sursa(job #2414170)

Utilizator StefanSanStanescu Stefan StefanSan Data 24 aprilie 2019 11:31:09
Problema Text Scor 90
Compilator cpp-64 Status done
Runda Arhiva de probleme Marime 0.49 kb
#include <iostream>
#include <algorithm>
#include <string>
#include <cmath>
#include <string.h>
#include <fstream>

using namespace std;

ifstream in("text.in");
ofstream out("text.out");

char c;
int nr, nrr;

int main() {
	bool ok = false ;
	while (in.get(c)) {
		if ((c <= 'z' && c >= 'a') || (c <= 'Z' && c >= 'A') || (c <= '9' && c >= '0')) {
			if (ok == false) {
				ok = true;
				nr++;
			}
			nrr++;
		}
		else {
			ok = false;
		}
		
	}
	out << nrr / nr;

}