Cod sursa(job #2449727)

Utilizator davidcotigacotiga david davidcotiga Data 20 august 2019 15:58:45
Problema Text Scor 0
Compilator cpp-64 Status done
Runda Arhiva de probleme Marime 0.33 kb
#include <iostream>
#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 >> ch){
		if (isalpha(ch))
			++let;
		if (k == 0) {
			word++;
			k = 1;
		}
		else
			k = 0;
	}
	fout << let / word;

	return 0;
}