Status conversion (Stack *S) { int inbase, outbase, number; int curr; int res; get_base(&inbase, &outbase); get_number(&number); curr = number; res = 0; if (inbase == 10 && outbase == 2) { BtoA(S, 2, number); } else if (inbase == 2 && (outbase == 8 || outbase == 16 || outbase == 10)) { BtoD(number, &res); BtoA(S, outbase, res); } else { printf("un support conversion now."); exit(ERROR); } return 0; }
int main(){ while(scanf("%s",str)!=EOF){ a.input(str); b=DtoB(a); b=reversion(b); a=BtoD(b); a.display(); } return 0; }