Cod sursa(job #1231974)

Utilizator Mirc100Mircea Octavian Mirc100 Data 21 septembrie 2014 19:59:14
Problema Text Scor 100
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.37 kb
#include<fstream>

using namespace std;
ifstream f("text.in");
ofstream g("text.out");
int main(){
	char c;
	char cant=0;
	int lung=0,nrcuv=0;
	while(f.get(c)){
		if((c>='a' && c<='z')||(c>='A' && c<='Z'))
			lung++;
		else
			if((cant>='a' && cant<='z')||(cant>='A' && cant<='Z'))
				nrcuv++;
		cant=c;
	} 
   
	g<<lung/nrcuv;
	f.close();
	g.close();

}