看csdn的帖子学习到的,写xls文件中,用/t隔开表示下个框, 用/n表示下一行,做了个代码
#include
<
stdio.h
>
int
main()
...
{ FILE *fxls; int n,m; int i,j; fxls=fopen("testxsl.xls","w"); printf("Please input N:"); scanf("%d",&n); printf("Please input M:"); scanf("%d",&m); printf("You put number N:%d M:%d",n,m); for(i=0;i<98;i++) ...{ for(j=0;j<98;j++) ...{ fprintf(fxls,"%d# ",(n+i)*(m+j)); /*# 代表tab*/ } fprintf(fxls,"# ");/*# 代表换行*/ } fclose(fxls); }