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