这段C语言程序哪里有错?
#include <stdio.h>#include <math.h>
int mul(int n);
int main()
{
FILE *fp;
if ((fp=fopen("SC3_6C.in","r"))!=NULL)
{freopen("SC3_6C.in", "r", stdin);
freopen("SC3_6C.out", "w", stdout);}
int i,j,a,n;
double sn,sum=0;
//************************************
scanf("%d%d",&a,&n);
j=n;
for(i=1;i<=n;i++)
{ sum=sum+j*a*(mul(i));
j--;
}
printf("%.f",sum);
//====================================
return 0;
}
int mul(int n)
{
int i,sn=1;
for(i=2;i<=n;i++)
{
sn=sn*10;
}
return sn;
}