Pagini recente » Irina | Profil fetitele_powerpuff | Autentificare | Statistici Jucovschi Constantin (jucovschi) | Cod sursa (job #1034749)
#include <iostream>
#include <stdio.h>
#include <string.h>
using namespace std;
int main()
{
FILE *f,*g;
f=fopen("text.in","r");
g=fopen("text.out","w");
char c;
long long nrc=0,nrl=0,ok=0;
while(!feof(f))
{
fscanf(f,"%c",&c);
if((c>='a'&&c<='z')||(c>='A'&&c<='Z'))
{
nrl++;
if(ok==0)
{
nrc++;
ok=1;
}
}
else
{
ok=0;
}
}
fprintf(g,"%lld",nrl/nrc);
fclose(f);
fclose(g);
return 0;
}