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