摘要: 1.求n个圆盘的汉诺塔的步骤 void Hanoi(int n,char a,char b,char c){ if(n==1)printf("Step %d Plate %d: %c-->%c\n",++step,n,a,c); else{ Hanoi(n-1,a,c,b); printf("Ste 阅读全文
posted @ 2023-02-28 20:00 天雷小兔 阅读(72) 评论(0) 推荐(0)
摘要: 1.8进制转16进制 string octs,hexs,t; void OtoH(){ for(int i=0;i<octs.length();i+=1){ string s=octs.substr(i,1); if(s=="0")t+="000"; if(s=="1")t+="001"; if(s 阅读全文
posted @ 2023-02-28 18:12 天雷小兔 阅读(108) 评论(0) 推荐(0)
摘要: 哈夫曼编码 阅读全文
posted @ 2023-02-28 11:45 天雷小兔 阅读(52) 评论(0) 推荐(0)