Cod sursa(job #615888)

Utilizator ionutmodoModoranu Ionut-Vlad ionutmodo Data 11 octombrie 2011 09:28:57
Problema Text Scor 100
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.58 kb
#include<fstream>
#include<cstring>
#include<iostream>

using namespace std;

char s[205],mat[205][205],x;

inline bool Ver(char x)
{
	return ( ('a'<=x && x<='z') || ('A'<=x && x<='Z'));
}

int main ()
{
	bool cuvant = false;
	char x;
	int nrcuv,nrlit;
	
	nrcuv = nrlit = 0;
	
	ifstream fin("text.in");
	
	while(fin.get(x))
	{
		if(Ver(x))
		{
			nrlit++;
			if(cuvant == false)
			{
				nrcuv++;
				cuvant = true;
			}
		}
		else cuvant = false;
	}
	fin.close();
	
	ofstream fout("text.out");
	fout<<(nrlit/nrcuv)<<"\n";
	fout.close();
	
	return 0;
}