Cod sursa(job #159006)
| Utilizator | Data | 13 martie 2008 22:08:45 | |
|---|---|---|---|
| Problema | Text | Scor | 0 |
| Compilator | cpp | Status | done |
| Runda | Arhiva de probleme | Marime | 0.36 kb |
#include<stdio.h>
#include<ctype.h>
long a,b,n,i,j;
FILE *f1,*f2;
char c;
int main(){
f1=fopen("text.in","r");
f2=fopen("text.out","w");
a=0;
while(!feof(f1)){
fscanf(f1,"%c",&c);
while(!isalpha(c)){
fscanf(f1,"%c",&c);
}
if(!feof(f1)){
i++;
}
while(isalpha(c)){
a++;
fscanf(f1,"%c",&c);
}
}
fprintf(f2,"%ld",a/i);
return 0;}
