1、1。将一个N进制数转换成M进制数#include#include#include#include #define num_len 100char IntToChar=0,1,2,3,4,5,6,7,8,9,a,b,c,d,e,f;int ConvertCharToInt(char ch)switch(ch)case 0:return 0;case 1:return 1;case 2:return 2;case 3:return 3;case 4:return 4;case 5:return 5;case 6:return 6;case 7:return 7;case 8:return 8;ca
2、se 9:return 9;case a:return 10;case b:return 11;case c:return 12;case d:return 13;case e:return 14;case f:return 15;default:return -1;int ConvertToTenBase(const char *result, int origbase)int reg=0;int len = strlen(result);for(int i=0;iresultorigbaseaimbase;reg=ConvertToTenBase(result,origbase);cout
3、Dump(); delete pOb; void main() Derive *pOb=new Derive; DestroyObj(pOb); 出 出 Call Value:Value(int nValue)/staticCall Base:Init()Call Derive:Derive()Value:m_nVal=0Call Derive:Derive()Call Base:Release()Call Value:Value()/static你看的文章来 中国IT先锋网 间a,b和c,d的题: 程序代码 程序代码/ #define BOOL int #define TRUE 1 #de
4、fine FALSE 0 BOOL jiba(int *p1, int *p2, int*pt) if (p1 = NULL) | (p2 = NULL) | (p10 p11) | (p20 p21) printf(“ 有误n“); return FALSE; if (p20 p11) return FALSE; else *pt = new int2; (*pt)0 = (p10 = p20 ? p10:p20); (*pt)1 = p11; return TRUE; return TRUE; /test! int rt2 =1,5; int rt12=3,9; int main() int *p = NULL; BOOL b = jiba(rt,rt1, if (b) printf(“%d,%d%d,%d的为%d,%dn“,rt0,rt1,rt10,rt11, p0,p1); delete p; else printf(“%d,%d%d,%d的为n“,rt0,rt1,rt10,rt11); getchar(); return 0;