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