Cod sursa(job #823269)

Utilizator antonioteoZait Teodor Antonio antonioteo Data 24 noiembrie 2012 20:44:23
Problema Text Scor 30
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.63 kb
#include <fstream>
#include <cstring>
using namespace std;
//const char iname[] = "text.in";
//const char oname[] = "text.out";
//ifstream fin(iname);
//ofstream fout(oname);
ifstream fin("text.in");
ofstream fout("text.out");
char s[ 1000000 ] , x;
int lg , i , j , lgt , nr_cuv;
int VeritaSerum ()
{
	for ( i = 0; i < lg; ++i )
	{
		if ( s[ i ] >= 'a' && s[ i ] <= 'z' )
		{
			while ( s[ i ] >= 'a' && s[ i ] <= 'z' )
			{
				++lgt;
				++i;
			}
			++nr_cuv;
		}
	}
	int vs = lgt / nr_cuv;
	return vs;
}
int main()
{
	fin.get ( s , 1000000 );
	lg = strlen ( s );
	fout << VeritaSerum () << '\n';
	return 0;
}