c語言實現乙個進製轉換程式

2021-08-25 02:33:34 字數 1230 閱讀 9495

可以實現常見的進製轉換,例如將十進位制轉換成八進位制等形式。

下面是實現**

#include "stdafx.h"

#include"math.h"

#include"stdlib.h"

int _tmain(int argc, _tchar* argv)

else

if (choose == 2)

else

if (choose == 3)

else

if (choose == 4)

else

if (choose == 5)

else

if (choose == 6)

else

if(choose==0)

printf("\n");

printf("\n");

printf("\n");

}return0;}

void szq(int n)

printf_s("進製轉化結果是:");

for (i--; i >= 0; i--) //將陣列倒序輸出

printf("%d", a[i]);

printf("\n");

}void qzs(int

m) for (i = ws; i >0; i--)

for (i = 1; i <= ws; i++)

}if (js == 0)

else

}void szsl(int n)

else

else

if (c == 11)

else

if (c == 12)

else

if (c == 13)

else

if (c == 14)

else

if (c == 15)

a[i] = c;

}num = num / n;

i++;

}printf_s("進製轉換結果是:");

for (i--; i >= 0; i--) //將陣列倒序輸出

printf("%c", a[i]);

printf("\n");

}

下面是程式執行結果

c語言實現進製轉換

c語言義實現進製轉換 include stdio.h include string.h include conio.h include stdlib.h include math.h include using namespace std int sel 選擇進製轉換 char zhs 50 xs ...

進製轉換C語言實現

所需標頭檔案 include include include include include using namespace std 十進位制轉二進位制 十進位制轉二進位制 string decimal to binary int decimal,int bits decimal為所要轉換的十進位制...

c語言 實現乙個棧

include include include include 入棧出站操作 typedef struct nodenode,pnode typedef struct stack pstack,stack void init pstack void push pstack,int bool isem...