Pagini recente » Cod sursa (job #2167780) | Cod sursa (job #2888463) | Cod sursa (job #1898906) | Cod sursa (job #240314) | Cod sursa (job #1104116)
#include<cstdio>
#include<cstring>
#include<cctype>
FILE *in,*out;
using namespace std;
int main()
{
in=fopen("text.in","rt");
char c;
int nrc=0;
int nrl=0;
bool ok=false;
while(!feof(in))
{
fscanf(in,"%c",&c);
if(isalpha(c))
{
nrl++;
if(ok==false)
{
nrc++;
ok=true;
}
}
else
ok=false;
}
fclose(in);
out=fopen("text.out","wt");
fprintf(out,"%ld",nrl/nrc);
fclose(out);
return 0;
}