Cod sursa(job #742807)

Utilizator RoPaulPersa Paul RoPaul Data 1 mai 2012 18:07:36
Problema Text Scor 0
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.38 kb
#include<fstream>
using namespace std;
int main()
{
	char text[5000];
	int i,cv=1,cif=0;
	ifstream f("text.in");
	ofstream g("text.out");
	f.getline(text,5000);
	for(i=1;i<=strlen(text);i++)
	{
		if(text[i]>='a' && text[i]<='z' || text[i]>='A' && text[i]<='Z')
			cif++;
		if(text[i]==' ' || text[i]=='-')
			cv++;
	}
	g<<cif/cv;
	f.close();
	g.close();
	return 0;
}