哪位大神来帮我把保存文件弄好啊 真的很急~~

newcomer_mz newcomer_mz 墨衍会员 · AI 创作全网分发 墨衍智能分发 通过墨衍一键同步至各平台 可同步平台 CSDN微信公众号微博知乎掘金百家号博客园抖音小红书 你的文章也可以这样分发 墨衍会员 ¥399起/年,写一次发全网 我也要 + 加入社区
求各位帮帮我把这个程序得到的结果保存到输出保存到outfile.txt文件中
各位帮忙把程序改动一下~真的很急。现在也没时间看文件的章节了,反正是举手之劳请各位高抬贵手吧
最好 改动了然后把全体粘贴出来,跪谢。。
#include<stdio.h>
int score[4][4],choose;
void fun()
{ int i,j,k,who;
score[1][1]=7;
score[2][1]=8;
score[3][1]=9;
for(i=1;i<=3;i++)
for(j=1;j<=3;j++)
for(k=1;i!=j&&k<=3;k++)
if(k!=i&&k!=j&&15-i-score[1][1]!=15-j-score[2][1]
&&15-i-score[1][1]!=15-k-score[3][1]
&&15-j-score[2][1]!=15-k-score[3][1]
&&15-i-score[1][1]!=i+1
&&15-j-score[2][1]!=j+1
&&15-k-score[2][1]!=k+1)
{
score[1][2]=i;score[1][3]=15-i-7;
score[2][2]=j;score[2][3]=15-j-8;
score[3][2]=k;score[3][3]=15-k-9;
}
for(who=0,i=1;i<=3;i++,printf("\n"))
for(j=1;j<=3;j++)
{
printf("%d",score[i][j]);
if(score[i][j]==1)who=i;
}
if(who==1)

printf("The last one arrived to end is a child from family Zhang.\n");
else if(who==2)
printf("The last one arrived to end is a child from family Wang.\n");
else printf("The last one arrived to end is a child from family Li.\n");
}
void main()
{
printf("welcome to my design !my c is who runs the least fast \n");
printf("if you want to go the program without thinking ,please put into 1\n");
printf("if you wan to go over slightly, please put into 2\n ");
scanf("%d",&choose);
switch(choose)
{
case 1:
{ fun();break;
}
case 2:printf("the program is over, thank you for your fitting\n");
default:break;
}
}
...全文

相关推荐

评论 5
收藏 已收藏
分享
返回顶部
newcomer_mz
C语言 70,039 成员 243,237 内容