#include <stdio.h>
#include <string.h>

static int abs(int n)
{
  if (n < 0) return -1;
  if (n > 0) return  1;
  return 0;
}

int main()
{
  printf("%d\n", abs(memcmp("abc", "abc", 3)));
  printf("%d\n", abs(memcmp("abc", "ABC", 3)));
  printf("%d\n", abs(memcmp("ABC", "abc", 3)));
  printf("%d\n", abs(memcmp("a", "aaa", 1)));
  printf("%d\n", abs(memcmp("aaa", "a", 1)));
  printf("%d\n", abs(memcmp("aaaa", "abcd", 3)));
  printf("%d\n", abs(memcmp("abcd", "aaaa", 3)));
  printf("%d\n", abs(memcmp("aaaa", "abcd", 1)));
  printf("%d\n", abs(memcmp("abcd", "aaaa", 1)));
  printf("%d\n", abs(memcmp("012", "0123", 4)));
  printf("%d\n", abs(memcmp("0123", "012", 4)));
  printf("%d\n", abs(memcmp("012", "0123", 3)));
  printf("%d\n", abs(memcmp("0123", "012", 3)));

  return 0;
}
