您当前的位置: 首页 > 

川川菜鸟

暂无认证

  • 4浏览

    0关注

    969博文

    0收益

  • 0浏览

    0点赞

    0打赏

    0留言

私信
关注
热门博文

任意进制转换

川川菜鸟 发布时间:2021-05-17 01:45:53 ,浏览量:4

//群:970353786
#include "stdio.h"
#include
using namespace std;
#define StackSize 100
typedef char ElemType;
typedef struct
{
    ElemType data[StackSize];
    int top;
}SqStack;
int trans(int d, int b, char string[])  //string用于存放转换后的字符串
{
    SqStack st;
    char ch;
    int r, i = 0;
    st.top = -1;      // 栈初始化
    if (b  36 || b == 10)  // 2≤b≤36且不为10
    {
        printf_s(" b is Error\n"); return 0;
    }
    while (d != 0)//辗转相除法
    {
        r = d % b; //求余数
        ch = r + (r             
关注
打赏
1665165634
查看更多评论
0.0674s