简单水题
#include<stdio.h>
#define NUM 1002
int ans[NUM];
int flag;
void reverse(int n, int radix)
{
int index=0,i,j;
while(n){
ans[index++]=n%radix;
n/=radix;
}
index--;
for(i=0,j=index;i<=(index-1)/2;i++){
if(ans[i]!=ans[j]){
flag=0;
break;
}
j--;
}
if(flag==1)
printf("Yes\n");
else
printf("No\n");
for(i=index;i>0;i--)
printf("%d ",ans[i]);
printf("%d\n",ans[0]);
}
int main()
{
int n,b;
while(scanf("%d%d",&n,&b)!=EOF){
flag=1;
reverse(n,b);
}
return 0;
}