Cod sursa(job #523804)

Utilizator lily3Moldovan Liliana lily3 Data 19 ianuarie 2011 13:16:18
Problema Text Scor 100
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.43 kb
#include<fstream>
using namespace std;
 
char x;
long i,n,m,ok=1,n1;
int main()
{
    ifstream f("text.in");
    ofstream g("text.out");
	i=0;
   while(!f.eof())
   {
	   f.get(x);
	   if((x>='a'&&x<='z')||(x>='A'&&x<='Z'))
	   {
		   ok=0;
		   m++;
	   }
	   else
		   if(!ok)
	   {
		   n++;
		  ok=1;
	   }
   }
   if(!ok)
	   n++;
   if(m!=0&&n!=0)
        g<<m/n;
   else
	   g<<0;
    return 0;
}