Cod sursa(job #133298)
Utilizator | Data | 8 februarie 2008 09:09:43 | |
---|---|---|---|
Problema | Text | Scor | 100 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.47 kb |
#include<stdio.h>
char c,c2;
long long a,b;
int main(){
FILE *f=fopen("text.in","r");
fscanf(f,"%c",&c);
if(c>=65&&c<=90||c>=97&&c<=122){
b++;
a++;
}
while(!feof(f)){
fscanf(f,"%c",&c2);
if(c2>=65&&c2<=90||c2>=97&&c2<=122){
a++;
if(!(c>=65&&c<=90||c>=97&&c<=122)){
b++;
}
}
c=c2;
}
fclose(f);
FILE *g=fopen("text.out","w");
fprintf(g,"%lld",a/b);
fclose(g);
return 0;
}