会的发个代码,我测试可以就给积分。
16进制转换10进制代码
- 提问者网友:难遇难求
- 2021-05-01 06:48
- 五星知识达人网友:逐風
- 2021-05-01 07:03
这个更简单
Private Sub Command1_Click()
MsgBox CDec("&h" & InputBox("请输入单个十六进制数"))
End Sub
- 1楼网友:青灯有味
- 2021-05-01 11:35
#include <stdio.h> #define M sizeof(unsigned int)*8
void trans(unsigned int n,unsigned int d, char s[]) { static char digits[] ="0123456789ABCDEF"; char buf[M+1]; int j, i = M; buf[i]='\0'; do { buf[--i]=digits[n%d]; n/=d; }while(n);
for(j=0;(s[j]=buf[i])!='\0';j++,i++); }
void main() { unsigned int num; int scale[]={16}; char str[33]; int i; printf("Please input a Number:\n"); scanf("%d",&num); for(i=0;i<sizeof(scale)/sizeof(scale[0]);i++) { trans(num,scale[i],str); printf("%5d = %s(%d)\n",num,str,scale[i]);
} printf("\n Press any key to quit...\n"); getch(); }
- 2楼网友:有你哪都是故乡
- 2021-05-01 10:01
- 3楼网友:怙棘
- 2021-05-01 08:22
最简单的VB代码来了:
Private Sub Command1_Click() Dim a As String a = InputBox("请输入十六进制数") Print Val("&H" + a) End Sub