Pagini recente » Cod sursa (job #2481877) | Cod sursa (job #738236) | Cod sursa (job #2829674) | Cod sursa (job #1660797) | Cod sursa (job #170961)
Cod sursa(job #170961)
#include<stdio.h>
int main()
{char c;
long i,nrl;
int ok,gg,nr,okk;
freopen("text.in","r",stdin);
freopen("text.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;
}