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