帮忙看看哪里出错了。提示参数中有错误字符!
#include <stdio.h>#include <math.h>
#define PI 3.14159265
main()
{
double ar[200],ai[200],br[200],bi[200];
double cr[200],ci[200],dr[200],di[200];
double sum1r[200],sum1i[200],sum2r[200],sum2i[200],dis[200];
double th;
float a;
int m,j,k,n;
FILE *pfile1=NULL,*pfile2=NULL,*pfile3=NULL,*pfile4=NULL,*pfile5=NULL;
pfile1=fopen("qrw1-r.txt","w");
pfile2=fopen("qrw2-i.txt","w");
pfile3=fopen("qrw3-r.txt","w");
pfile4=fopen("qrw4-i.txt","w");
pfile5=fopen("qrw5-dis.txt","w");
scanf("%lf",&a);
th=a*PI/180;
n=100;
k=n/2;
for(m=0;m<n;m++)
{
ar[m]=0.0;ai[m]=0.0;br[m]=0.0;bi[m]=0.0;cr[m]=0.0;ci[m]=0.0;dr[m]=0.0;di[m]=0.0;
sum1r[m]=0.0;sum1i[m]=0.0;sum2r[m]=0.0;sum2i[m]=0.0;dis[m]=0.0;
}
ar[k]=1.0;br[k]=0.0;
for(j=1;j<k-1;j++)
{
for(m=1;m<n-1;m++)
{
cr[m]=ar[m+1]*cos(th)+br[m+1]*sin(th);
ci[m]=ai[m+1]*cos(th)+bi[m+1]*sin(th);
dr[m]=ar[m-1]*sin(th)-br[m-1]*cos(th);
di[m]=ai[m-1]*sin(th)-bi[m-1]*cos(th);
sum1r[j]+=cr[m]*dr[m]+ci[m]*di[m];
sum1i[j]+=ci[m]*dr[m]-cr[m]*di[m];
sum2r[j]+=(cr[m]*dr[m]+ci[m]*di[m])*(m-k);
sum2i[j]+=(ci[m]*dr[m]-cr[m]*di[m])*(m-k);
}
for(m=1;m<n;m++)
{
ar[m]=cr[m];br[m]=dr[m];ai[m]=ci[m];bi[m]=di[m];
if(j==k-2) dis[m]=ar[m]*ar[m]+ai[m]*ai[m]+br[m]*br[m]+bi[m]*bi[m];
}
}
for(j=1;j<k-1;j++)
{
printf("%d %12.8f\n", j, sum2r[j]);
fprintf(pfile1, "%d %12.8f\n", j, sum1r[j]);
fprintf(pfile2, "%d %12.8f\n", j, sum1i[j]);
fprintf(pfile3, "%d %12.8f\n", j, sum2r[j]);
fprintf(pfile4, "%d %12.8f\n", j, sum2i[j]);
}
for(m=1;m<n;m++)
{
printf("%d %12.8f\n", m, dis[m]);
fprintf(pfile5, "%d %12.8f\n", m, dis[m]);
}
fclose(pfile1);fclose(pfile2);fclose(pfile3);fclose(pfile4);fclose(pfile5);
getch();
}