Cod sursa(job #38840)

Utilizator MirageRobert Sandu Mirage Data 26 martie 2007 10:29:33
Problema Text Scor 10
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.5 kb
#include<stdio.h>
#include<string.h>
char n[500];
int main () {
	char end;
	int nr=0,nr2=0,nr3,c,i;
	FILE *in=fopen("text.in","r"), *out=fopen("text.out","w");
	end=fscanf(in,"%s",&n);
	nr++;
	nr3=strlen(n);
	while(end!=EOF){
		nr2+=strlen(n);
		for(i=0;i<nr3;i++){
			c=nr3;
			if(((((n[c-2]-'0')<48)&&((n[c-2]-'0')>32)))||(((n[c-2]-'0')<65)&&((n[c-2]-'0')>57)))
				nr2--;
			c--;
		}
		end=fscanf(in,"%s",&n);
		nr3=strlen(n);
		nr++;
	}
	nr2--;
	fprintf(out,"%d\n",nr2/nr);
	return 0;
}