#include int main (void) { int n; int m; scanf("%d", &n); scanf("%d", &m); short s[11];//文字列入力用 int j = 0; while (0 < m) { int i = m % n; s[j] = i; j++; m /= n; } j--; for (; 0 <= j; j--) { printf("%d", s[j]); } printf("\n"); return 0; }