#include <stdio.h>
int main()
{
int x,n,i,j;
long long sum,g;
while(scanf("%d%d",&x,&n)!=EOF)
{
sum=0;
for(i=1;i<=n;i++)
{
g=1;
for(j=1;j<=i;j++)
{
g*=x;
}
sum+=g;
}printf("%lld\n",sum);
}
}
标签:1222,int,sum,d%,long,计算,include
来源: https://www.cnblogs.com/cy846586184/p/12248783.html