进制转化 10进制转化为其它进制
#include<iostream>
#include<cstdlib>
using namespace std;
#define size 100
int a[size+1],n,d,i=0,j;
int main()
{
cout<<"Please enter a number(N)base 10";
cin>>n;
cout<<"Please enter a number(d)";
cin>>d;
do{
a[++i]=n%d;
n/=d;
}while(n!=0);
for(j=i;j>=1;j--)
cout<<a[j];
return 0;
}