Cod sursa(job #806780)

Utilizator edytzu15Andrei Edouard edytzu15 Data 3 noiembrie 2012 15:21:19
Problema Text Scor 40
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.39 kb
#include <fstream>
#include <string.h>
using namespace std;
char text[1000000];
int lung,i,cuv,nr;
int main()
{
	ifstream f("text.in");
	ofstream g("text.out");
	f.get(text,1000000);
	do{
		if(text[i]>='a'&&text[i]<='z'||text[i]>='A'&&text[i]<='Z'){
			lung++;
			cuv=1;
		}
		else
			if(cuv==1){
				nr++;
				cuv=0;
			}
		i++;
	}while(text[i]);
	
	g<<lung/nr;
	
	
	
}