Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int strdiff(char *a, char *b){
- int ans;
- int count, rem = 0;
- for (count = 0; *a && *b && *a==*b; count++, a++, b++)
- /*while (*a && *b && *a==*b){
- count += 1;
- a += 1;
- b += 1;
- } */
- if ((*a==0) && (*b==0)) ans = -1;
- // char a1 = *a, b1 = *b; хз зайдет ли оно если убрать эти переменные, если чо вернешь их обратно
- while ((*a & 1) == (*b & 1)){
- rem+=1;
- *a>>=1;
- *b>>=1;
- }
- ans = 8*count + rem;
- return ans;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement