Cod sursa(job #448759)

Utilizator nickyyLal Daniel Emanuel nickyy Data 4 mai 2010 17:45:03
Problema Text Scor 70
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.4 kb
#include <fstream>
using namespace std;

int main(void)
{char c;
 int nr=0,lg=0;
 fstream fin,fout;
 fin.open("text.in", ios::in);
 fout.open("text.out", ios::out);
 while(!fin.eof())
	{fin.get(c);
	 if((c>='A' && c<='Z') || (c>='a' && c<='z'))
		{while((c>='A' && c<='Z') || (c>='a' && c<='z'))
			{lg++; fin.get(c);		}
		 nr++;
		}
	}
 fout<<lg/nr;
 fin.close(); fout.close();
 return 0;
}