printf("What do you want?\n"); printf("1:Ten.\n"); printf("2:Octal.\n"); printf("3:Hexacdecimal.\n"); printf("0:Exit.\n"); x1: scanf("%d",&t); if(t>=0||t<=3) { if(t==1) { if(emark==1) { m=b_to_t(a); n=b_to_t(c); printf("%d.%d",m,n); } else { m=b_to_t(a);printf("%d",m);} } if(t==2) { if(emark==1) { m=b_to_t(a); n=b_to_t(c); printf("%o.%o",m,n); } else { m=b_to_t(a);printf("%o",m);} } if(t==3) { if(emark==1) { m=b_to_t(a); n=b_to_t(c); printf("%x.%x",m,n); } else { m=b_to_t(a);printf("%x",m);} } if(t==0) exit(); } else { printf("Your choice is wrong,please choice again!"); goto x1; } getch(); } int b_to_t(char array[]) { int num,s,i=0; if(array[0]=='-'||array[0]=='+') { s=array[0]=='-'?-1:1; i++;} for(num=0; array[i]!=0; i++) num=num*2+array[i]-'0'; num=s*num; return nu; }

我想做一个二进制与其他进制转化的程序,可不知道那里错了,谁能帮我该一下?谢谢了

搜索更多相关的解决方案: 改改  

----------------解决方案--------------------------------------------------------
各位拜托了
----------------解决方案--------------------------------------------------------
查看全文
  相关解决方案