Cod sursa(job #444886)

Utilizator lily3Moldovan Liliana lily3 Data 21 aprilie 2010 23:12:24
Problema Text Scor 70
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.36 kb
#include<fstream>
using namespace std;
 
char x;
long i,n,m,ok=0;
int main()
{
    ifstream f("text.in");
    ofstream g("text.out");
   while(!f.eof())
   {
	   f.get(x);
	   if((x>='a'&&x<='z')||(x>='A'&&x<='Z'))
	   {
		   ok=0;
		   m++;
	   }
	   else
		   if(!ok)
	   {
		   n++;
		  ok=1;
	   }
   }
        g<<m/(n-1);
    return 0;
}