Mai intai trebuie sa te autentifici.
Cod sursa(job #329985)
| Utilizator | Data | 8 iulie 2009 13:17:05 | |
|---|---|---|---|
| Problema | Text | Scor | 40 |
| Compilator | cpp | Status | done |
| Runda | Arhiva de probleme | Marime | 0.46 kb |
#include <stdio.h>
FILE *f,*g;
char c;
int ok;
long s,n;
int main(){
f=fopen("text.in","r");
g=fopen("text.out","w");
n=s=0;
c='q';
while (!feof(f)&&c!='\n'){
fscanf(f,"%c",&c);
if (97<=c&&c<=122){
ok=1;
n++;
}
else
if (65<=c&&c<=90){
ok=1;
n++;
}
else
if (ok==1){
ok=0;
s++;
}
}
if (65<=c&&c<=90) n++;
else
if (97<=c&&c<=122) n++;
fprintf(g,"%ld\n",n/s);
fclose(f);
fclose(g);
}
