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