//把10进制转化成n进制 #include<bits/stdc++.h> using namespace std; int n,num; int a[100010]; int main() { cin>>n>>num; int i=0; while(num) { a[++i]=num%n; num/=n; } while(i) { if(a[i]>=10) cout<<char(a[i]-10+'A'); else cout<<a[i]; i--; } return 0; }
标签:10,进制,int,转化,while,num From: https://www.cnblogs.com/wqy2003/p/16906763.html