Cod sursa(job #906178)

Utilizator RoseCosmina Rebeca Rose Data 6 martie 2013 16:15:51
Problema Text Scor 30
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.33 kb
#include<string.h>
#include<fstream>
using namespace std;
int n,i,nr,cuv;
char v[501];
ifstream f("text.in");
ofstream g("text.out");
int main()
{
	f.get(v,500);
	f.get();
	
	n=strlen(v);
	for(i=0;i<n;i++)
		if(isalpha(v[i])){nr++;
		if(!isalpha(v[i+1]))cuv++;}
	if(isalpha(v[n-1]))cuv++;
	g<<nr/cuv;
		return 0;
}