fork download
  1. #include <stdio.h>
  2.  
  3.  
  4.  
  5. int any(char s1[], char s2[]){
  6. int i, j;
  7. i = j = 0;
  8. while (s1[i] != '\0'){
  9. while (s2[j] != '\0'){
  10. if (s1[i] == s2[j++])
  11. return i;
  12. }
  13. i++;
  14. }
  15. return -1;
  16. }
  17.  
  18.  
  19.  
  20. int main(void) {
  21. printf("%d", any("cba", "ac"));
  22. return 0;
  23. }
  24.  
Success #stdin #stdout 0s 2052KB
stdin
Standard input is empty
stdout
Standard output is empty