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