void main()
{
unsigned char x1,x2,x3,x4
int x=0
scanf("%x%x%x%x",&x1,&x2,&x3,&x4)//输入的时候不需要输入0x,直接输入00 01 e2 40就好了
printf("%x %x %x %x\n",x1,x2,x3,x4)
x|=x1
x=x<<8
x|=x2
x=x<<8
x|=x3
x=x<<8
x|=x4
printf("%d\n",x)
}
看了楼主的问题才知道原来bash还可以用数组。于是谷歌了下,发现这篇文章,http://www.centoscn.com/shell/2013/0331/196.html楼主可以参考一下。使用起来跟C里面差不多 譬如 static int a[]={1,2,3,4,5}。欢迎分享,转载请注明来源:内存溢出
评论列表(0条)