fork(8) download
  1. #include <stdio.h>
  2. #include <string.h>
  3.  
  4. int main() {
  5. char s1[20];
  6. char s2[20];
  7. printf("Digite uma string : ");
  8. scanf("%s", s1);
  9. printf("Digite outra string : ");
  10. scanf("%s", s2);
  11. printf("%ld", strstr(s1, s2) - s1);
  12. }
  13.  
  14. //https://pt.stackoverflow.com/q/213806/101
Success #stdin #stdout 0s 4388KB
stdin
algoritmo
ritmo
stdout
Digite uma string : Digite outra string : 4