#include <stack> using namespace std; char IntToChar(long long res,int b) { res %= b; if(res >= 10) return res+'A'-10; else return res+'0'; } int main() { int a,b; string n; long long res; int tmp; while(cin>>a>>n>>b){ res = 0; ...