Cod sursa(job #828460)

Utilizator StexanIarca Stefan Stexan Data 3 decembrie 2012 19:56:30
Problema Text Scor 40
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.5 kb
#include<fstream>
#include<string.h>
#include<ctype.h>
using namespace std;

ifstream f("text.in");
ofstream g("text.out");

char x[1000005];
int cuvinte, litere,i,raise,r;

int main()
{
	char *p;
	int r=0;
	

	for(i=0; f.get(x[i]); i++)
	{
		if(isspace( x[i]) )
			while( isspace(x[i]) )
		{
			i++;
			f.get(x[i]);
		}
		cuvinte++;
		while( !isspace(x[i]) )
			{
				if(isalpha(x[i]))
					litere++;
				i++;
				f.get(x[i]);
			}
	}

	g<<litere/(cuvinte-1);

return 0;
}