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. if(s[i]!=t[i]){
  7. return 0;
  8. }
  9. }
  10. return 1;
  11.  
  12. }
  13.  
  14. int main(){
  15. int ans;
  16. char s[100];
  17. char t[100];
  18. scanf("%s %s",s,t);
  19. ans = myStrcmp(s,t);
  20. printf("%s = %s -> %d\n",s,t,ans);
  21. return 0;
  22. }
  23.  
Success #stdin #stdout 0s 5280KB
stdin
abcd
abcb
stdout
abcd = abcb -> 0