Cod sursa(job #709360)

Utilizator Hunter6699Szekeres Szabolcs Hunter6699 Data 8 martie 2012 00:08:56
Problema Text Scor 0
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.45 kb
#include <iostream>
#include <string>
#include <fstream>
#include <math.h>
using namespace std;

int main(){
	ifstream fin("text.in");
	ofstream fout("text.out");
	char s;
	int charszam=0,szoszam=0;
	bool ok=false;
	{while(fin.get(s)){
		fin>>s;
		if((s>='a'&&s<='z')||(s>='A'&&s<='Z')){
			charszam++;
			ok=true;
		}else if(ok){
			szoszam++;
			ok=false;
		}
		
	}
	fin.close();
	fout<<charszam/szoszam;
	fout.close();
	return 0;
}