数据导出excel 表格
#include<iostream.h>#include<conio.h>
#include<fstream.h>
#include<iomanip.h>
#include<math.h>
#include<stdio.h>
#define PI 3.1415926
void main()
{
int i,XH[361];
double a=112,b=336,c;
double s3,n1,n2;
double phi[361],delta[361],xsa[361],ysa[361];
for(i=0;i<=360;i++)
{
XH[i]=i+1;
phi[i]=0+PI*i/180;
n1=a*sin(phi[i]);
n2=-1*sqrt(b*b-a*a*sin(phi[i])*sin(phi[i]));
delta[i]=atan2(n1,n2);
s3=a*cos(phi[i])-b*cos(phi[i]);
c=-b*b/a;
xsa[i]=a*cos((phi[i])*PI/180)+c*cos((delta[i])*PI/180+PI);
ysa[i]=a*sin((phi[i])*PI/180)+c*sin((delta[i])*PI/180+PI);
}
for(i=0;i<=360;i++)
{
printf("%lf %lf\n",xsa[i],ysa[i]);
}
}
请教要把xsa,ysa数据导出到excel表格要怎么写