Cod sursa(job #584835)
Utilizator | Data | 26 aprilie 2011 19:44:45 | |
---|---|---|---|
Problema | Text | Scor | 0 |
Compilator | c | 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;
}