#include
void main()
{
char b[17]={"0123456789ABCDEF"};
int c[64],d,i=0,base=16;
long n;
printf("Enter a number:\n"); scanf("%ld",&n);
do
{
c[i]=n%base;i++;n=n/base;
}while(n!=0);
printf("Transmite new base:\n");
for(;i>=0;--i)
{
d=c[i];printf("%c",b[d]);
}
printf("\n");
}
#include
main()
{ char b[17]={"0123456789ABCDEF"};
int c[64],d,i=0,base=16;
long n;
printf("Enter a number:\n"); scanf("%ld",&n);
do {
c[i]=n%16;i++;n=n/base;}
while(n!=0);
printf("Transmite new base:\n");
for(i--;i>=0;--i)
{ d=c[i];printf("%c",b[d]); }
printf("\n");
}
#include
#define max 100
void main()
{int i=0;
char c[max];
long n;
printf("Enter a number:\n");
scanf("%ld",&n);
do{
c[i]=n%16;i++;n=n/16;
}while(n!=0);
printf("Transmite new base:\n");
for(;i>=0;--i){
swicth(i){
case 1:
case 2:
case 1:
printf("%c",b[d]);
printf("\n");
}
偶忘的差不多了。。。
wo yun 我学VB 就够呛了