Cod sursa(job #584834)

Utilizator horatiu13Horatiu horatiu13 Data 26 aprilie 2011 19:44:33
Problema Text Scor 0
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.44 kb
#include<Stdio.h>
#include<string.h>
#include<ctype.h>
int main()
{
FILE*g=fopen("text.in","r"),*f=fopen("text.out","w");
char v[525000],w[]="qwertyuiopasdfghjklzxcvbnmQWERTYUIOPASDFGHJKLZXCVBNM",c[]=" -,.!;:";
int i,n,cc=0,cl=0;
fgets(v,525000,g);
n=strlen(v);
for(i=0;i<n;i++)
{
	 if(strchr(w,v[i]))
	 {
		 cl++;
	 }
	 else
	 {
		 if(strchr(c,v[i])&&strchr(w,v[i-1]))
			 cc++;
	 }
}

fprintf(f,"%d",cl/cc);

return 0;
}