Cod sursa(job #949267)

Utilizator BLz0rDospra Cristian BLz0r Data 13 mai 2013 00:23:20
Problema Text Scor 100
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.43 kb
#include <cstdio>
#include <cstring>
using namespace std;

FILE *f=fopen ("text.in","r");
FILE *g=fopen ("text.out","w");

int main(){
	int i,lgcuv=0,cuv=0;
	bool reset=0;
	char x;
	
	
	while (x!=EOF){
		x=EOF;
		fscanf (f,"%c",&x);
		if ((x>=97 && x<=122) || (x>=65 && x<=90)){
			lgcuv++;
			if (!reset){
				cuv++;
			}
			reset=1;
		}
		else{
			reset=0;
		}
	}
	fprintf (g,"%d",lgcuv/cuv);
	
	
	return 0;
}