#include <stdio.h>
#define n 189
long aa[n][2]={
     0x3d800000,0xfffc0000,
     0x3d840000,0xffff0000,
     0x3d850000,0xffff8000,
     0x3d858000,0xffffc000,
     0x3d85c000,0xffffe000,
     0x3d860000,0xffff8000,
     0x3d868000,0xffffc000,
     0x3d870000,0xffff8000,
     0x3d87e000,0xffffe000,
     0x3d880000,0xfffe0000,
     0x3d8a0000,0xffffc000,
     0x3d8a8000,0xffffc000,
     0x3d8b0000,0xffff8000,
     0x3d8c0000,0xfffc0000,
     0x3d950000,0xffff0000,
     0x3d960000,0xfffe0000,
     0x3d980000,0xfffc0000,
     0x3d9c0000,0xfffe0000,
     0x3d9e0000,0xffff0000,
     0x3d9f0000,0xffffc000,
     0x3d9f8000,0xffffc000,
     0x89bd0000,0xffff0000,
     0x8f590000,0xffff0000,
     0x90d60000,0xffff0000,
     0x93080000,0xffff0000,
     0x98680000,0xffff0000,
     0x9e840000,0xffff0000,
     0x9eb60000,0xffff0000,
     0x9fe20000,0xffff0000,
     0xa1cf0000,0xffff0000,
     0xa25da000,0xffffe000,
     0xa2690000,0xffff0000,
     0xa66f0000,0xffff0000,
     0xa78b0000,0xffff0000,
     0xa7d80000,0xffff0000,
     0xa8a00000,0xffff0000,
     0xc07c9a00,0xffffff00,
     0xc08b8700,0xffffff00,
     0xc08b8800,0xffffff00,
     0xc0aa4f00,0xffffff00,
     0xc0cf5b00,0xffffff00,
     0xc0f5d000,0xffffff00,
     0xc670a900,0xffffff00,
     0xca048000,0xffffe000,
     0xca04fc00,0xfffffc00,
     0xca0c1300,0xffffff00,
     0xca0e5000,0xffffff00,
     0xca0eeb00,0xffffff00,
     0xca0eec00,0xffffff00,
     0xca0eee00,0xffffff00,
     0xca146400,0xfffffe00,
     0xca16fc00,0xfffffc00,
     0xca260000,0xfffff000,
     0xca262d00,0xffffff00,
     0xca264000,0xffffc000,
     0xca268400,0xfffffc00,
     0xca269300,0xffffff00,
     0xca269800,0xfffffe00,
     0xca26a100,0xffffff00,
     0xca26a400,0xfffffc00,
     0xca26b000,0xffffff00,
     0xca26c000,0xffffc000,
     0xca288900,0xffffff00,
     0xca288a00,0xffffff00,
     0xca289d00,0xffffff00,
     0xca28c000,0xfffff000,
     0xca28d000,0xfffff800,
     0xca28d800,0xfffffe00,
     0xca28db00,0xffffff00,
     0xca28de00,0xfffffe00,
     0xca2d2000,0xffffe000,
     0xca2d8000,0xffffff00,
     0xca40ba00,0xffffff00,
     0xca428000,0xffffc000,
     0xca4b4000,0xfffff800,
     0xca4b4800,0xfffffc00,
     0xca4d2700,0xffffff00,
     0xca540a00,0xfffffe00,
     0xca541000,0xfffffe00,
     0xca55a800,0xfffff800,
     0xca5b8000,0xfffffc00,
     0xca5bf000,0xfffff000,
     0xca5c0000,0xfffffc00,
     0xca5d0000,0xfffff000,
     0xca5dfc00,0xfffffc00,
     0xca5e0000,0xffffe000,
     0xca5f0000,0xfffffc00,
     0xca600000,0xffff0000,
     0xca610000,0xffffe000,
     0xca616000,0xffffe000,
     0xca618000,0xffff8000,
     0xca620000,0xfffe0000,
     0xca640000,0xfffc0000,
     0xca680000,0xfff80000,
     0xca700000,0xfff80000,
     0xca780000,0xfffe0000,
     0xca7a0100,0xffffff00,
     0xca7a0700,0xffffff00,
     0xca7a8000,0xffffff00,
     0xca7f0000,0xfffffe00,
     0xca7f0c00,0xfffffc00,
     0xca7f1000,0xfffff000,
     0xca7f2800,0xfffff800,
     0xca7f3000,0xfffffe00,
     0xca7f9000,0xfffff000,
     0xca7fa000,0xfffff800,
     0xca7fc000,0xfffffe00,
     0xca7fc800,0xfffff800,
     0xca7fd000,0xfffffe00,
     0xca820000,0xffffe000,
     0xca829800,0xfffffe00,
     0xca82e000,0xffffe000,
     0xca864000,0xffffe000,
     0xca88fe00,0xffffff00,
     0xcaacd200,0xffffff00,
     0xcac00000,0xfff00000,
     0xcb41f000,0xfffffc00,
     0xcb543f00,0xffffff00,
     0xcb558900,0xffffff00,
     0xcb57e000,0xffffe000,
     0xcb580000,0xfffffc00,
     0xcb5a0000,0xfffffc00,
     0xcb5d0000,0xffff0000,
     0xcb5e0000,0xfffffc00,
     0xcb5f0000,0xfffff800,
     0xcbc40000,0xfffff800,
     0xcbcf4000,0xffffc000,
     0xcbcf8000,0xffff8000,
     0xcbd00000,0xfffff000,
     0xcbd01000,0xffffff00,
     0xcedb2c00,0xfffffe00,
     0xcedb3200,0xfffffe00,
     0xcedb3400,0xfffffe00,
     0xcedce000,0xfffffc00,
     0xcfb06000,0xfffffe00,
     0xd20c0000,0xffff8000,
     0xd20c8000,0xffffc000,
     0xd20ec000,0xffffc000,
     0xd20f0000,0xffffc000,
     0xd20f4000,0xffffe000,
     0xd2190000,0xffff0000,
     0xd21a0000,0xfffe0000,
     0xd21c0000,0xfffc0000,
     0xd2200000,0xfff00000,
     0xd2480000,0xffff8000,
     0xd248a000,0xffffe000,
     0xd248c000,0xffffc000,
     0xd2490000,0xffff0000,
     0xd24a2000,0xffffe000,
     0xd24a4000,0xfffffe00,
     0xd24a6000,0xffffe000,
     0xd24a8000,0xffff8000,
     0xd24b2000,0xffffe000,
     0xd24b6000,0xffffe000,
     0xd24b8000,0xffff8000,
     0xd24c0000,0xffffc000,
     0xd24c6000,0xffffe000,
     0xd24ca000,0xffffe000,
     0xd24cc000,0xffffe000,
     0xd24d0000,0xffffc000,
     0xd24d6000,0xffffe000,
     0xd24d8000,0xffffe000,
     0xd24da000,0xfffff000,
     0xd24dc000,0xffffc000,
     0xd24e0000,0xffffe000,
     0xd24e8000,0xffffe000,
     0xd24fe000,0xffffe000,
     0xd2c06000,0xffffe000,
     0xd3400000,0xfff80000,
     0xd3500000,0xffff0000,
     0xd35a0000,0xfffe0000,
     0xd35c0000,0xffff0000,
     0xd35d0000,0xffff8000,
     0xd35d8000,0xffffc000,
     0xd35e0000,0xfffe0000,
     0xd3600000,0xfffe0000,
     0xd3620000,0xffff8000,
     0xd3630000,0xffff8000,
     0xd363a000,0xffffe000,
     0xd363c000,0xffffc000,
     0xd3640000,0xffff8000,
     0xd3650000,0xffffc000,
     0xd3658000,0xffff8000,
     0xd3670000,0xffff8000,
     0xd3980000,0xffff8000,
     0xd3a30000,0xffffc000,
     0xd3a74000,0xffffc000,
     0xd3a78000,0xffffe000,
     0xd3a7c000,0xffffc000 };

main(ac,av)
int ac; char *av[];
{
  int i,j,k;
  char a[40];
  int a1,a2,a3,a4;
  unsigned long l1,l2;
  if(ac>1){ strcpy(a,av[1]); goto l11; }
  printf("\n\t **** check an IP free or not (in digitial)*****\n");
  printf("\n\t\t\t\t\t jiang 2000.6\n\n");
l10:
  printf("input IP: ");
  scanf("%s",a); fflush(stdin);
  i=a[0]&0xdf;
  if(i=='E' || i=='Q')exit();
l11:
  k=strlen(a);
  for(i=0;i<k;i++)if(a[i]=='.'||a[i]=='/')a[i]=32;
  a1=a2=a3=a4=0;
  sscanf(a,"%d %d %d %d",&a1,&a2,&a3,&a4);
  ch(&l1,a1,a2,a3,a4);
  k=0;
  for(i=1;i<n;i++)if(aa[i][0]>l1)goto l20;
  goto quit;
l20:
  i--;
  l2=l1&aa[i][1];
  if(l2==aa[i][0])k=1;
quit:
  if(k==0)printf("\t\t\t**** not\n"); else printf("\t\t\t**** free\n");
  if(ac<=1)goto l10;
}


ch(a,a1,a2,a3,a4)
char a[4];
int a1,a2,a3,a4;
{
  a[3]=a1&0xff;
  a[2]=a2&0xff;
  a[1]=a3&0xff;
  a[0]=a4&0xff;
}
