fork download
  1. # include <stdio.h>
  2.  
  3. int myStrcmp(char s[], char t[]){
  4. int i;
  5.  
  6. for(i = 0; s[i] == t[i]; i++){
  7. if(s[i] == '\0'){
  8. return 1;
  9. }
  10. }
  11. return 0;
  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 0.01s 5284KB
stdin
abcd
abcd
stdout
abcd = abcd -> 1