#include<stdio.h>
#include<math.h>
int main()
{
int a,n,count=1;
int sn=0,tn=0;
printf("Please input a and n: \n");
scanf("a=%d,n=%d",&a,&n);
printf("a=%d,n=%d\n",a,n);
do
{
tn=a;
sn+=tn;
tn+=a*pow(10,count);
count++;
}while(count<=n);
printf("a+aa+...=%ld\n",sn);
return 0;
}
qq_玲_3
相关分类