Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<stdio.h>
- int any(char s[], char t[])
- {
- int i,j;
- for(i=0;i<strlen(s);i++)
- {
- for(j=0;j<strlen(t);j++)
- {
- if(s[i]==t[j])
- {
- return (i+1);
- }
- }
- }
- return -1;
- }
- int main()
- {
- int i;
- char s[1000],t[1000];
- scanf("%s",s);
- scanf("%s",t);
- int outcome=any(s,t);
- printf("%d\n",outcome);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement