Pagini recente » Cod sursa (job #3293461) | Cod sursa (job #3038144) | Cod sursa (job #2075393) | Cod sursa (job #862185) | Cod sursa (job #380454)
Cod sursa(job #380454)
#include<cstdio>
#include<cstdlib>
using namespace std;
#define FIN "text.in"
#define FOUT "text.out"
int main()
{FILE *fi=fopen(FIN,"r");
FILE *fo=fopen(FOUT,"w");
char c;
long long contor=0,lg=0,curent=0;
while(fscanf(fi,"%c", &c)!=EOF)
{if(('a'<=c && c<='z')||('A'<=c && c<='Z'))
{lg++;
if(curent==0) curent=1;
}
else {if(curent==1) {curent=0;contor++;}
}
}
fprintf(fo,"%ld",lg/contor);
return 0;}