回复 楼主 chinagdvea
#include<stdio.h>
int main(void)
{
int num,n;
long pow(int num,int n);
printf("Now enter a number and N\n");
scanf("%d %d",&num,&n);
printf("a+aa+aaa+...=%ld\n",pow(num,n));
}
long pow(int num,int n)
{
int i;
long sum=0,temp;
for(temp=num,i=1;i<=n;i++)
{
sum=sum+temp;
temp*=temp;
}
return sum;
}
貌似不妨碍运行