Pagini recente » Cod sursa (job #1333288) | Borderou de evaluare (job #1941551) | Cod sursa (job #221558) | Cod sursa (job #2204079) | Cod sursa (job #1084097)
#include <stdio.h>
using namespace std;
char ch,ch1;
int c,z;
int main()
{
FILE*f;
f=fopen("text.in","r");
while(!feof(f))
{
ch1=ch;
fscanf(f,"%c",&ch);
if((ch>=65&&ch<=90)||(ch>=97&&ch<=122)) z++;
else if((ch1>=65&&ch1<=90)||(ch1>=97&&ch1<=122)) c++;
}
FILE*g;
g=fopen("text.out","w");
fprintf(g,"%d",z/c);
fclose(g);
fclose(f);
return 0;
}