fork(36) download
  1. #include <stdio.h>
  2.  
  3. int strcmp(char *s, char *t){
  4. if ( strlen(s) != strlen(t) ) return 0;
  5. int i;
  6. char cs, ct;
  7. for (i=0; s[i] !='\0' ; i++){
  8. cs = s[i];
  9. ct = t[i];
  10. /* TODO */
  11. }
  12. return 1;
  13. }
  14.  
  15. int strlen(char* str){
  16. int i, cnt=0;
  17. for (i=0; str[i]!='\0'; i++){
  18. cnt++;
  19. }
  20. return cnt;
  21. }
  22.  
  23. int main(){
  24. char s[32];
  25. char t[32];
  26. int i, ans;
  27. scanf("%s %s",s,t);
  28. printf("%d\n", strcmp(s,t));
  29. return 0;
  30. }
  31.  
Success #stdin #stdout 0s 4436KB
stdin
Abd aBc
stdout
1