Pagini recente » Cod sursa (job #2062084) | Cod sursa (job #1403727) | Cod sursa (job #1892478) | Cod sursa (job #1699127) | Cod sursa (job #380460)
Cod sursa(job #380460)
#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;}