> n;.\rassert ((n > 1) & & (n < = 16));\rint num = 0;\rfor (i = 0, j = lengt" /> > n;.\rassert ((n > 1) & & (n < = 16));\rint num = 0;\rfor (i = 0, j = lengt" />

全文预览

C实例代码

上传者:你的雨天 |  格式:pdf  |  页数:41 |  大小:2944KB

文档介绍
[j] < = "f")\rb [j] = a [j] $ ' a' + 10;\relsa\rreturn false;\r)\rcout < ’âqrI+)É÷]ën : ' ;\rint n\rcin > > n;.\rassert ((n > 1) & & (n < = 16));\rint num = 0;\rfor (i = 0, j = length - 1; j > = 0; j ---, i + +) / / qr\rI+ìîˆ]ë\r{num + = b [i] * pow (n, j);\r)\rcout < ’”ìíî]ë+m : ';\rint m;\rcin > > m;\rcout < < endl;\rassert ((m > 1) & & (m < = 16));\rstack < char > tcs;\rchar to remain;\rwhile (num. = 0) / / ìî m ]ë\rto remain = digit num% [m]..\rstk. push (to remain);\rnum / - m;\r}\rcout < ’â‚"?/ / q‡‚\rwhile (! stk. empty ())\r{\rcout < < stk. top ();\rstk. pop ();\r)\rcout < < endl;\rreturn 0;

收藏

分享

举报
下载此文档