Cod sursa(job #1998283)

Utilizator Eduard663676Ghiuzan Eduard Eduard663676 Data 7 iulie 2017 12:45:00
Problema Text Scor 0
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.63 kb
#include <iostream>
#include <stdio.h>
#include <fstream>

using namespace std;

int main() {
	char x;
	unsigned long long int q = 0, l = 0, c = 0;
	ifstream citire("text.in");
	ofstream afisare("text.out");
	do {
		citire.get(x);
		q = 0;
		if (x >= 'a' && x <= 'z' || x >= 'A' && x <= 'Z')
			l++;
		else 
			while (q == 0) {
				citire.get(x);
				if (citire.eof())
					break;
				if (x >= 'a' && x <= 'z' || x >= 'A' && x <= 'Z') {
					l++;
					q = 1;
				}
			}
		if (q == 1)
			c++;
	} while (!citire.eof());
	afisare << l << ' ' << c << ' ' << l / c;
	citire.close();
	afisare.close();
	return 0;
}