首页 > 其他分享 >ch9.13

ch9.13

时间:2022-12-03 13:31:10浏览次数:46  
标签:return ch9.13 int char l1 fun include

#include<stdio.h>

#include<string.h>

int fun(char a[],char b[],int l,int l1);

int main()

{int l,l1;

char a[1000],b[10];

gets(a);l=strlen(a);

gets(b);l1=strlen(b);

fun(a,b,l,l1);

return 0;

}

int fun(char a[],char b[],int l,int l1)

{int i,j,c=0,k;

for(i=l-l1;i>=0;i--)

{for(j=0;j<l1;j++)

{if(a[i+j]-'0'==b[j]-'0')c++;

}

if(c==l1)break;

c=0;

}

if(c==l1)

{for(k=i;k<l;k++)

printf("%c",a[k]);

}

else printf("not be found!");

return 0;

}

标签:return,ch9.13,int,char,l1,fun,include
From: https://blog.51cto.com/u_15758636/5908536

相关文章