#include "stdafx.h"
#include<stdlib.h>
struct number{
int num;
struct number *next;
};
int _tmain(int argc, _TCHAR* argv[])
{
int N,jinwei=0,value,a[100],sign=0,k;
struct number *head,*temp,*p;
head=(struct number *)malloc(sizeof(struct number));
head->next=NULL;
head->num=0;
temp=(struct number *)malloc(sizeof(struct number));
temp->num=1;
temp->next=NULL;
head->next=temp;
scanf("%d%d",&N,&k);
for(int i=0;i<N;i++)
{
jinwei=0;
p=head;
while(p->next!=NULL)
{
p=p->next;
value=p->num*k;
p->num=(value+jinwei)%10;
jinwei=(value+jinwei)/10;
if(jinwei!=0&&p->next==NULL)
{
temp=(struct number *)malloc(sizeof(struct number));
temp->num=jinwei;
temp->next=NULL;
p->next=temp;
p=p->next;
}
}
}
return 0;
}
//一个int 型数字存储最多到2^32;