Cod sursa(job #170956)

Utilizator jupanu92Anonim jupanu92 Data 3 aprilie 2008 16:21:38
Problema Text Scor 0
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.71 kb
#include<stdio.h>
int main()
{char c;
long i,nrl;
int ok,gg,nr,okk;
freopen("text.in","r",stdin);
freopen("teext.out","w",stdout);
i=0;nrl=0;nr=0;
c = fgetc(stdin);
okk=0;
while(feof(stdin))
   {ok=0;gg=0;
   while(c>='a'&&c<='z' || c>='A'&&c<='Z'){nrl++;c = fgetc(stdin);;ok=1;}
   if(ok==1){i++;okk=1;}
   if(c=='-') {c = fgetc(stdin);
	       nrl++;
	       if(c=='m'){c = fgetc(stdin);nrl++;
			  if(c=='a') i++;
			    }
			else if(c=='l')
				{c = fgetc(stdin);
				 if(c=='e') i++;
				  nrl++;
				  }
				 else if(c=='n')
					{c = fgetc(stdin);
					if(c=='e')i++;
					 nrl++;
					 }
 
		 }

      c = fgetc(stdin); 


   }


if(okk==1)printf("%ld",(nrl-nr)/i);

return 0;
}