Cod sursa(job #959803)

Utilizator miron_dorin95Miron Dorin miron_dorin95 Data 8 iunie 2013 20:42:44
Problema Text Scor 100
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.43 kb
#include <fstream>
#include <string>
using namespace std;
int main ()
{
	int cuv=0,i,n,lit=0,k=0;
	char x;
	ifstream f("text.in");
	while ( f.get(x) )
	{
        if( (x>='a' && x<='z') || (x>='A' && x<='Z') )
        {
				lit++;
				k=1;
        }
        else
            if(k)
            {
                k=0;
                cuv++;
            }
	}
	f.close();
	ofstream g("text.out");
	g<<lit/cuv;
	return 0;
}