Cod sursa(job #175381)

Utilizator ghiutaalexGhiuta Alex ghiutaalex Data 9 aprilie 2008 21:24:31
Problema Text Scor 90
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.37 kb
#include<stdio.h>
long x,y;
int main()
{char c,s;
 FILE*f=fopen("text.in","r");
 FILE*g=fopen("text.out","w");
 fscanf(f,"%c",&c);
 if(c>='a'&&c<='z'||c>='A'&&c<='Z') x++;
 s=c;
 while(!feof(f))
	{fscanf(f,"%c",&c);
	 if(c>='a'&&c<='z'||c>='A'&&c<='Z') x++;
	 else if(s>='a'&&s<='z'||s>='A'&&s<='Z') y++;
	 s=c;}
 fprintf(g,"%d",x/y);
 fcloseall();
 return 0;
}