怎么我这个程序编译结果输出到TXT文件里
#include "stdio.h"char panzhihe(int x)
{char i;
if(x==0)i='h';
else if(x==4)i='h';
else if(x==6)i='h';
else if(x==8)i='h';
else if(x==9)i='h';
else if(x==1)i='z';
else if(x==2)i='z';
else if(x==3)i='z';
else if(x==5)i='z';
else if(x==7)i='z';
else if(x==9)i='z';
else i='c';
return(i);
}
char panjiou(int x)
{char i;
if(x==1)i='j';
else if(x==3)i='j';
else if(x==5)i='j';
else if(x==7)i='j';
else if(x==9)i='j';
else if(x==2)i='o';
else if(x==4)i='o';
else if(x==6)i='o';
else if(x==8)i='o';
else if(x==0)i='o';
else i='c';
return(i);
}
char pandaxiao(int x)
{char i;
if(x<=4)i='x';
else if(x>4)i='d';
else i='c';
return(i);
}
main()
{ static char b[50][3],c[50][3],d[50][3],e[50][3]={{'c','c','c'},{'c','c','c'}};
static int f[50][3],a[50][3]={{9,7,3},{2,2,7},{0,5,8},{9,8,8},{1,0,7},{8,1,2},{8,4,7},{8,4,2},{4,9,3},{9,6,9},{9,5,2},{3,9,2},{3,8,8},{7,8,7},{5,9,8},{2,9,0},{8,1,8},{5,6,6},{1,3,4},{6,6,9},{6,6,5},{1,6,1},{6,5,6},{4,1,3},{7,6,4},{6,7,3},{7,2,1},{5,6,9},{7,4,2},{4,6,4},{9,4,0},{5,9,0},{7,2,7},{8,9,4},{6,9,0},{2,6,6},{1,0,8},{4,9,7},{5,2,3},{4,4,8},{3,9,2},{3,1,2},{1,9,2},{3,2,0},{4,0,7},{7,2,7},{2,4,5},{3,7,2},{2,6,6},{6,3,0}};
static int i,j,z,h,ji,o,da,x,max=0,min=0;
for (i=2;i<50;i++)
{if(a[i][0]==a[i-1][0])e[i][0]='f';
else if(a[i][0]==a[i-1][1])e[i][0]='f';
else if(a[i][0]==a[i-1][2])e[i][0]='f';
else if(a[i][0]==a[i-2][0])e[i][0]='g';
else if(a[i][0]==a[i-2][1])e[i][0]='g';
else if(a[i][0]==a[i-2][2])e[i][0]='g';
else e[i][0]='z';
}
for (i=2;i<50;i++)
{if(a[i][1]==a[i-1][0])e[i][1]='f';
else if(a[i][1]==a[i-1][1])e[i][1]='f';
else if(a[i][1]==a[i-1][2])e[i][1]='f';
else if(a[i][1]==a[i-2][0])e[i][1]='g';
else if(a[i][1]==a[i-2][1])e[i][1]='g';
else if(a[i][1]==a[i-2][2])e[i][1]='g';
else e[i][1]='z';
}
for (i=2;i<50;i++)
{if(a[i][2]==a[i-1][0])e[i][2]='f';
else if(a[i][2]==a[i-1][1])e[i][2]='f';
else if(a[i][2]==a[i-1][2])e[i][2]='f';
else if(a[i][2]==a[i-2][0])e[i][2]='g';
else if(a[i][2]==a[i-2][1])e[i][2]='g';
else if(a[i][2]==a[i-2][2])e[i][2]='g';
else e[i][2]='z';
}
for (i=0;i<50;i++)
for (j=0;j<3;j++)
{b[i][j]=panzhihe(a[i][j]);
c[i][j]=panjiou(a[i][j]);
d[i][j]=pandaxiao(a[i][j]);
f[i][0]=a[i][0]+a[i][1]+a[i][2];
f[i][1]=f[i][0]%10;
}
for (i=0;i<50;i++)
{f[i][0]=a[i][0]+a[i][1]+a[i][2];
f[i][1]=f[i][0]%10;
}
for (i=0;i<50;i++)
{max=a[i][0];min=a[i][0];
for (j=0;j<3;j++)
{
if(max<=a[i][j])max=a[i][j];
if(min>=a[i][j])min=a[i][j];
}
f[i][2]=max-min;
}
printf("开奖号 和 合 跨 质合 奇偶 大小 复隔中质比奇比大比");
for (i=0;i<50;i++)
{z=0;h=0;ji=0;o=0;da=0;x=0;printf("\n");
printf(" %d %d %d",a[i][0],a[i][1],a[i][2]);
printf(" %d %d %d",f[i][0],f[i][1],f[i][2]);
printf(" %c %c %c",b[i][0],b[i][1],b[i][2]);
printf(" %c %c %c",c[i][0],c[i][1],c[i][2]);
printf(" %c %c %c",d[i][0],d[i][1],d[i][2]);
printf(" %c %c %c",e[i][0],e[i][1],e[i][2]);
for (j=0;j<3;j++)
{if(b[i][j]=='z')z=z+1;
else if(b[i][j]=='h')h=h+1;
else z=z;
if(c[i][j]=='j')ji=ji+1;
else if(c[i][j]=='o')o=o+1;
else o=o;
if(d[i][j]=='d')da=da+1;
else if(d[i][j]=='x')x=x+1;
else x=x;
}
printf(" %d %d %d %d %d %d",z,h,ji,o,da,x);
}
}