#include
#include
using namespace std;
int main()
{
int x,n;
string S;
cout << "x = ",cin >> x;
cout <<"n = ",cin >> n;
while(x / n > 0){
cout <<x / n<<" "<<x % n<<"\n";<br> S = (char)(x % n<10?x % n+'0':x % n+'A'-10)+S;<br> x = x / n;
}
if(x!=0){S = (char)(x<10?x+'0':x+'A'-10)+S;}<br> cout <<"x_n = "<<S<<"\n";<br> system("Pause");
return 0;
}