http://pta.patest.cn/pta/test/13/exam/3/question/475
#include <stdio.h>
#include<math.h>
int fn( int a, int n );
int SumA( int a, int n );
int main()
{
int a, n;
scanf("%d %d", &a, &n);
printf("fn(%d, %d) = %d\n", a, n, fn(a,n));
printf("s = %d\n", SumA(a,n));
return 0;
}
int fn( int a, int n )
{
int sum=0,i,b=1;
for(i=0;i<n;i++)
{
//b=b*10;
sum=sum+a*b;
b