我也试试……
#include<stdio.h>
void main()
{int a,n,i,m,sum;
printf("please input the a and n\n");
scanf("%d,%d",&a,&n);
if(n<1)
printf("ERROR\n");
else
{
sum=a;
m=a;
for(i=1;i<n;i++)
{
sum=a+sum*10; /* sum为该串数中的最大值 */
m=m+sum; /* m为和 */
}
}
printf("result is %d\n",m);
}
#include<stdio.h>
void main()
{int a,n,i,m,sum;
printf("please input the a and n\n");
scanf("%d,%d",&a,&n);
if(n<1)
printf("ERROR\n");
else
{
sum=a;
m=a;
for(i=1;i<n;i++)
{
sum=a+sum*10; /* sum为该串数中的最大值 */
m=m+sum; /* m为和 */
}
}
printf("result is %d\n",m);
}

我很懒,但我讨厌别人说我懒……