Pagini recente » Cod sursa (job #2695436) | Cod sursa (job #3132678) | Cod sursa (job #513787) | Cod sursa (job #984172) | Cod sursa (job #371286)
Cod sursa(job #371286)
//while(!feof(f));
#include<stdio.h>
using namespace std;
char x;
int lit,cuv,ok;
int main()
{
FILE *f=fopen("text.in","r"), *g=fopen("text.out","w");
fscanf(f,"%c",&x);
if( (x>64 && x<91) || (x>96 && x<123) )
{lit=1; cuv=1; ok=1;}
while(!feof(f))
{fscanf(f,"%c",&x);
if( (x>64 && x<91) || (x>96 && x<123) )
{lit++;
if(!ok) {cuv++; ok=1;}
}
else ok=0;
}
fprintf(g,"%d\n",lit/cuv);
fclose(f);
fclose(g);
return 0;
}