今天用递归写了个简单的进制转换函数,帖出来。 int fss(int a,int b)//a为要转换的数字,b为要转换的数制 { if (a>=0&&a<b){cout<<a; return a;} else{cout<<a%b;return fss(a/b,b);} }