Cod sursa(job #122656)
| Utilizator | Data | 13 ianuarie 2008 13:22:04 | |
|---|---|---|---|
| Problema | Text | Scor | 0 |
| Compilator | cpp | Status | done |
| Runda | Arhiva de probleme | Marime | 0.42 kb |
#include <stdio.h>
int main()
{ char i,x;
long ok,cuv=0,car=-1,sol,ok2=0;
FILE*f=fopen("text.in","r");
FILE*g=fopen("text.out","w");
while(!feof(f))
{
ok=0;
fscanf(f,"%c",&x);
for (i='a';i<='z';i++)
if (i==x) {ok=1; break;}
if (ok==0) for (i='A';i<='Z';i++)
if(i==x) {ok=1; break;}
if (ok==1) { car++; if (ok2==0) cuv++; ok2=1; }
else ok2=0;
}
sol=car/cuv;
fprintf(g,"%ld",sol)
return 0;
}
