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