Cod sursa(job #2451813)

Utilizator davidcotigacotiga david davidcotiga Data 28 august 2019 12:14:13
Problema Text Scor 0
Compilator cpp-64 Status done
Runda Arhiva de probleme Marime 0.37 kb

#include <iostream>
#include <string>
#include <fstream>
using namespace std;

int main() {
	ifstream fin("text.in");
	ofstream fout("text.out");

	char ch;
	int let = 0, word = 0, k = 0;
	
	
	while (fin.get(ch)) {
		
		if (isalpha(ch))
			++let;
		if (k == 0) {
			word++;
			k = 1;
		}
		else
			k = 0;

	}
	
	fout << let / word;

	return 0;
}