实现a+aa+aaa+aaaa+....,a由键盘输入,例如输入3,则实现3+33+333
main()
{
int k,i,n,sum=0,total=0;
printf("intput n: ");
scanf("%d",&n);
k=n;
for(i=2;i<=n;i++)
{
n=n*10+k;
sum=sum+n;
}
total=sum+k;
printf("total=%d\n",total);
getch();
}
------------------------------------
到底错在哪儿????