Cod sursa(job #449128)

Utilizator deiosxHalalai Tudor Andrei deiosx Data 5 mai 2010 19:48:02
Problema Text Scor 0
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.35 kb
#include<stdio.h>
#include<ctype.h>
#include<string.h>
#define rd fscanf
#define wr fprintf
FILE *f=fopen("text.in","r"),*g=fopen("text.out","w");
int i,x,j,ok;
char s[1000];
int main()
{
while(!feof(f))
{
rd(f,"%s");
ok=0;
for(j=0;j<strlen(s);j++)
if(isalpha(s[i]))ok++;
if(ok==j)
{
i++;
x=x+strlen(s);
}
}
wr(g,"%2.f",x/i);
return 0;
}