如何修改程序导出结果?例如导出结果到E盘,我用的C语言编程软件是wintc,谢谢!例如下面程序 5
#include"stdio.h"main(){intA,B,C,D,E,F,G,H,I,J;printf("pleaseinputnumbers\n");scanf("...
#include "stdio.h"
main()
{ int A,B,C,D,E,F,G,H,I,J;
printf("please input numbers\n");
scanf("%2d,%2d,%2d,%2d,%2d,%2d,%2d,%2d,%2d,%2d",&A,&B,&C,&D,&E,&F,&G,&H,&I,&J);
printf("%2d %2d %2d %2d %2d %2d\n",A,B,E,G,I,J);
printf("%2d %2d %2d %2d %2d %2d\n",B,C,D,F,H,I);
printf("%2d %2d %2d %2d %2d %2d\n",A,C,E,G,H,J);
getch();
} 展开
main()
{ int A,B,C,D,E,F,G,H,I,J;
printf("please input numbers\n");
scanf("%2d,%2d,%2d,%2d,%2d,%2d,%2d,%2d,%2d,%2d",&A,&B,&C,&D,&E,&F,&G,&H,&I,&J);
printf("%2d %2d %2d %2d %2d %2d\n",A,B,E,G,I,J);
printf("%2d %2d %2d %2d %2d %2d\n",B,C,D,F,H,I);
printf("%2d %2d %2d %2d %2d %2d\n",A,C,E,G,H,J);
getch();
} 展开
展开全部
#include <stdio.h>
#include<stdlib.h>
main()
{ int A,B,C,D,E,F,G,H,I,J;
FILE *FP;
FP = fopen("E:\\my.txt", "w");
printf("please input numbers\n");
scanf("%2d,%2d,%2d,%2d,%2d,%2d,%2d,%2d,%2d,%2d",&A,&B,&C,&D,&E,&F,&G,&H,&I,&J);
fprintf(FP, "%2d %2d %2d %2d %2d %2d\n",A,B,E,G,I,J);
fprintf(FP, "%2d %2d %2d %2d %2d %2d\n",B,C,D,F,H,I);
fprintf(FP, "%2d %2d %2d %2d %2d %2d\n",A,C,E,G,H,J);
//getch();
return 0;
}
#include<stdlib.h>
main()
{ int A,B,C,D,E,F,G,H,I,J;
FILE *FP;
FP = fopen("E:\\my.txt", "w");
printf("please input numbers\n");
scanf("%2d,%2d,%2d,%2d,%2d,%2d,%2d,%2d,%2d,%2d",&A,&B,&C,&D,&E,&F,&G,&H,&I,&J);
fprintf(FP, "%2d %2d %2d %2d %2d %2d\n",A,B,E,G,I,J);
fprintf(FP, "%2d %2d %2d %2d %2d %2d\n",B,C,D,F,H,I);
fprintf(FP, "%2d %2d %2d %2d %2d %2d\n",A,C,E,G,H,J);
//getch();
return 0;
}
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询