cn++; } }
for(i=0;i lena=strlen(tmp[i]); for(j=0;j return count; } void main() { char *s=\ int n,i; FILE *fp; fp=fopen(\ if(fp==0) {printf(\ n=findword(s,t,ch); for(i=0;i printf(\ \ fprintf(fp,\ \ } printf(\ fprintf(fp,\ fprintf(fp,\ fclose(fp); } 模拟测试题二: 改错: while(ia c[count++]=a[ia];//c[count]=a[ia]; printf(\编程: #include void josephu(int a[],int b[],int n,int m) { int i=0,flag=1,cn=0; while(cn if(a[i]==0) i=(i+1); else if(flag<3) { i=(i+1); flag++; } else if(flag==3) { b[cn++]=a[i]; a[i]=0; flag=1; i=(i+1); } } } void main() { int n,m,i,a[100],b[100]; FILE *fp; fp=fopen(\ if(fp==0) {printf(\ printf(\ for(i=0;i josephu(a,b,n,m); for(i=0;i printf(\ fprintf(fp,\ } fprintf(fp,\ fclose(fp); } 模拟测试题三: 改错: int str_count(char string[],char substr[],int ioc[])//int str_count(char *string[],char *substr[],int ioc[]) for(j=i,k=0;substr[k]==string[j];k++,j++)//for(j=i,k=0;substr[k]==string[k];k++,j++) ioc[m++]=i+1;//ioc[++m]=i+1; char str[80]=\编程: #include void squeeze(char *s1,char *s2,char *s3) { char *p,*q; int i=0; while(*s1) { p=s2; while(*p&&*p!=*s1) p++; if(*p) { s3[i++]=*s1; q=s1; while(*q) { *q=*(q+1); q++; } s1--; } s1++; } s3[i]=0; } void main() { FILE *fp; char *s1=\ fp=fopen(\ if(fp==0) {printf(\ squeeze(s1,s2,s3); printf(\ fprintf(fp,\ printf(\ fprintf(fp,\ fprintf(fp,\ fclose(fp); } 模拟测试题四: 改错: #define N 10//#define N=10 void yanghui(int y[][N],int x[][N],int n)//void yanghui(int y[][N],x[][N],n) y[i][j]=y[i-1][j-1]+y[i-1][j];//y[i][j]=y[i-1][j+1]+y[i-1][j]; for(j=0;j #include char *q=p,temp[20]; while(*p) { while(*p&&isalpha(*p)) p++; if(*p) { strcpy(temp,p); *p++='-'; strcpy(p,temp); } while(*p&&isdigit(*p)) p++; } return q; } void main() { FILE *fp; char *p=\ fp=fopen(\ if(fp==0) {printf(\ q=insert(p); printf(\ fprintf(fp,\ fprintf(fp,\ fclose(fp); } 模拟测试题五: 改错: void insert_date(int y,int m,int d,char *s,int n)//void insert_date(int y,int m,int d,char s,int n) y%=(int)pow(10,3-i);//y/=(int)pow(10,3-i); strcat(s,t);//strcpy(s,t);