Cod sursa(job #806231)

Utilizator razvan9310FMI - Razvan Damachi razvan9310 Data 2 noiembrie 2012 02:16:42
Problema Text Scor 30
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.44 kb
#include <fstream>
#include <string.h>
using namespace std;

int main()
{
	ifstream in("text.in"); ofstream out("text.out");
	char text[2000000];
	int l = 0, cuv = 0, i;
	in.get(text, 2000000);
	for (i=0;i<strlen(text);i++)
		if ((text[i] >= 'A' && text[i] <= 'Z') || (text[i] >= 'a' && text[i] <= 'z'))
		{
			l++;
			if (i && (text[i-1] < 'A' || text[i-1] > 'Z') && (text[i-1] < 'a' || text[i-1] > 'z'))
				cuv++;
		}
	out<<l/cuv;
}