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