Pagini recente » Cod sursa (job #1879867) | Cod sursa (job #1247495) | Cod sursa (job #2057236) | Cod sursa (job #1073307) | Cod sursa (job #97931)
Cod sursa(job #97931)
#include<iostream.h>
#include<string.h>
#include<stdio.h>
int main()
{
char s[1000000],sr[]=" 1234567890-=`~!@#$%^&*()_+;:[]{}'<>,.?/\|",*p;
int n=0,k=0,x,i=1;
s[0]="1";
FILE *fin,*fout;
fin=fopen("text.in","r");
while(s[i-1]!=NULL)
{fscanf(fin,"%c",&s[i]);i++;}
p=strtok(s,sr);
while(p!=NULL){n++;k+=strlen(p);p=strtok(NULL,sr);}
x=k/n;
fout=fopen("text.out","w");
fprintf(fout,"%d",x);
fclose(fin);
fclose(fout);
return 0;
}