概述
该楼层疑似违规已被系统折叠 隐藏此楼查看此楼
#include
#include
#define SIZE(a) (sizeof(a)/sizeof(a[0]))
#define HBIT(a) ((a & 0x00000080) != 0)
#define LBIT(a) ((a & 0x00000001) != 0)
int TAB[] = {
0x10, 0x71, 0x12, 0x10, 0x10, 0x7C, 0x00, 0x00,
0x00, 0x00, 0x00, 0x3C, 0x42, 0x42, 0x42, 0x04,
0x04, 0x08, 0x10, 0x20, 0x42, 0x7E, 0x00, 0x00,
0x00, 0x00, 0x00, 0x3C, 0x42, 0x42, 0x04, 0x18,
0x04, 0x02, 0x02, 0x42, 0x44, 0x38, 0x00, 0x00,
0x00, 0x00, 0x00, 0x04, 0x0C, 0x14, 0x24, 0x24,
0x44, 0x44, 0x7E, 0x04, 0x04, 0x1E, 0x00, 0x00,
0x00, 0x00, 0x00, 0x7E, 0x40, 0x40, 0x40, 0x58,
0x64, 0x02, 0x02, 0x42, 0x44, 0x38, 0x00, 0x00,
0x00, 0x00, 0x00, 0x1C, 0x24, 0x40, 0x40, 0x58,
0x64, 0x42, 0x42, 0x42, 0x24, 0x18, 0xC0, 0xDE
};
void Move()
{
int i, j, len;
len = SIZE(TAB);
for(i = 0; i
{
j = i ? (i - 1) : (len - 1);
if(HBIT(TAB[i]) != LBIT(TAB[j]))
TAB[j] = (unsigned int)TAB[j] ^ 0X00000001;
TAB[i] = (unsigned int)TAB[i] <
TAB[i] = (unsigned int)TAB[i] & 0X000000FF;
TAB[j] = (unsigned int)TAB[j] & 0X000000FF;
}
printf("%#04X, %#04Xn", TAB[0], TAB[1]);
}
int main(void)
{
printf("%#04X, %#04Xn", TAB[0], TAB[1]);
while(TAB[0] != 0XC0 || TAB[1] != 0XDE)
Move();
system("PAUSE");
return EXIT_SUCCESS;
}
最后
以上就是端庄唇彩为你收集整理的c语言矩阵行列循环移位,如何将一个数组的元素循环左移?的全部内容,希望文章能够帮你解决c语言矩阵行列循环移位,如何将一个数组的元素循环左移?所遇到的程序开发问题。
如果觉得靠谱客网站的内容还不错,欢迎将靠谱客网站推荐给程序员好友。
发表评论 取消回复