8 1300 48 2 1 7 0
2504 1000
#include<iostream> using namespace std; void A(int k,int b) { if(k) { A(k/b,b); printf("%c",k%b>9?k%b-10+'A':k%b+48); } } int main() { int m,a,b; while(cin>>m>>a>>b,m) { if(a+b==0) { cout<<0<<endl; continue; } A(a+b,m); cout<<endl; } return 0; }
原文地址:http://blog.csdn.net/lsgqjh/article/details/44958507