###### 实现数据的反序

X:123 R:10 输出：321
X:-123 R:10 输出：-321
X:123 R:8 输出：371

void Signed(int ,int );
void Unsigned(int ,int );

int main()
{
int a,i;
printf(“Input the number:”);
scanf(“%3d”,&a);
printf(“Input the number system(2¡¢8¡¢10 or 16):”);
scanf(“%2d”,&i);
if(a == 0)
{
printf(“NO PROCESS!\n”);
return;
}
if(a != abs(a)) //输入数据为负数
Signed(a,i);
else
Unsigned(a,i);
return 0;
}

void Unsigned(int a,int i)
{ int t;
switch(i)
{
case 2:
{
printf(“The Binary inversion number is:”);
while(a != 0)
{
t = a%2;
a = a/2;
printf(“%d”,t);
}
printf(“\n”);
break;
}
case 8:
{
printf(“The Octal inversion number is:”);
while(a != 0)
{
t = a%8;
a = a/8;
printf(“%d”,t);
}
printf(“\n”);
break;
}
case 10:
{
printf(“The Decimal inversion number is:”);
while(a != 0)
{
t = a%10;
a = a/10;
printf(“%d”,t);
}
printf(“\n”);
break;
}
case 16:
{
while(a != 0)
{
t = a%16;
a = a/16;
printf(“%d”,t);
}
printf(“\n”);
break;
}
}
}

void Signed(int a,int i)
{
int t;
a = abs(a);
switch(i)
{
case 2:
{
printf(“The Binary inversion number is:-“);
while(a != 0)
{
t = a%2;
a = a/2;
printf(“%d”,t);
}
printf(“\n”);
break;
}
case 8:
{
printf(“The Octal inversion number is:-“);
while(a != 0)
{
t = a%8;
a = a/8;
printf(“%d”,t);
}
printf(“\n”);
break;
}
case 10:
{
printf(“The Decimal inversion number is:-“);
while(a != 0)
{
t = a%10;
a = a/10;
printf(“%d”,t);
}
printf(“\n”);
break;
}
case 16:
{
while(a != 0)
{
t = a%16;
a = a/16;
printf(“%d”,t);
}
printf(“\n”);
break;
}
}
}

#### 单链表反序（反转）C++实现

2017-06-23 14:53:56

#### 字母反序输出（栈的应用）

2017-03-16 09:31:12

#### 单链表反序，逆序的两种方法

2016-12-05 21:42:36

#### 用C语言实现数组反序

2016-01-20 16:06:48

#### Java 实现单链表反序

2014-08-07 11:49:24

#### 对链表进行反序输出

2015-11-02 14:30:28

#### 单链表反序原理

2016-07-25 08:45:02

#### 递归算法反序输出字符串

2017-04-20 10:21:07

#### python题目-----序列反序操作

2017-01-19 14:27:29

#### C语言进阶之路------字符串的反序输出（输入字符串然后调用函数反序输出）

2017-05-16 23:44:53