Cod sursa(job #686474)

Utilizator michael9ufoStanescu Mihai michael9ufo Data 21 februarie 2012 17:16:27
Problema Text Scor 10
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.64 kb
#include <iostream>
#include <cstring>
#include <fstream>

using namespace std;

int main()
{

	freopen("text.in", "r", stdin);

        freopen("text.out", "w", stdout);
	
	char *text;

        int lit = 0, cuv = 0;

        text = new char[256];

	cin>>text;

        fclose(stdin);

        bool ic = 0;

	while(*text)
	{

		if((*text >= 'a' && *text <= 'z') || (*text >= 'A' && *text <= 'Z'))
		{
			if(!ic)
			{
				ic = 1;
                                ++cuv;
			}

			++lit;
		 }
		 else
                 	ic = 0;
         text++;
        }

	cout<<lit/cuv<<"\n";

	fclose(stdout);

	return 0;

}