fork download
  1. # include <stdio.h>
  2.  
  3. int myStrcmp(char s[], char t[]){
  4. int i;
  5. for (i = 0; s[i] == t[i]; i++)
  6. {
  7. if (s[i] == '\0')
  8. return 1;
  9. }
  10. return 0;
  11. }
  12.  
  13. int main(){
  14. int ans;
  15. char s[100];
  16. char t[100];
  17. scanf("%s %s",s,t);
  18. ans = myStrcmp(s,t);
  19. printf("%s = %s -> %d\n",s,t,ans);
  20. return 0;
  21. }
  22.  
Success #stdin #stdout 0.01s 5292KB
stdin
abcd
abcd
stdout
abcd = abcde -> 0