Pagini recente » Cod sursa (job #1563696) | Cod sursa (job #3158073) | Cod sursa (job #1324363) | Cod sursa (job #2589065) | 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;
}