1、最后运行结果:代码:#include #include typedef struct Nodeint data;struct Node *next;StackNode;StackNode *top = NULL;void Push(int e)StackNode *p;p = (StackNode *)malloc(sizeof(StackNode);p-data = e;p-next = top;top = p;bool IsEmpty()return top = NULL ? true : false;int Pop()StackNode *p;int e;if (IsEmpty()pri
2、ntf(“The stack is empty, failed to pop!n“);return NULL;p = top;e = p-data;top = top-next;free(p);return e;void Print()StackNode *p;p = top;if (IsEmpty()printf(“The stack is empty!n“);return;printf(“转换后的结果是:“);while (p)if (p-datadata);elseif (p-data = 10)printf(“a“);else if (p-data = 11)printf(“b“);e
3、lse if (p-data = 12)printf(“c“);else if (p-data = 13)printf(“d“);else if (p-data = 14)printf(“e“);else if (p-data = 15)printf(“f“);else printf(“data is wrong!“);p = p-next;printf(“n“);void main()int m, c, d, n;printf(“请输入要转换的十进制数:“);scanf(“%d“, printf(“n“);printf(“请输入转换进制:n“);printf(“*n“);printf(“* 请选择一个你要转换的进制 *n“);printf(“* 1.二进制 *n“);printf(“* 2.八进制 *n“);printf(“* 3.十六进制 *n“);printf(“*n“);scanf(“%d“, printf(“n“);if (d = 1)n = 2;else if (d = 2)n = 8;else if (d = 3)n = 16;else printf(“输入有误!“);while (m)c = m%n;m = m / n;Push(c);Print();