首先在编写如

#define _CRT_SECURE_NO_WARNINGS
#include<stdio.h>
#include<stdlib.h>

void main()
{
	int a = 0;
	scanf("%d",&a);
	printf("%d\n",a);
	system("pause");
}

生成 cmd.exe, 打开 cmd 并进入到 cmd.exe 的目录

我们可以再新建以个1.txt并在里面输入 123

在cmd窗口中输入:
cmd 输入输出

< : 是将 1.txt 中输入的数据输出到 cmd.exe 正如代码中的 scanf() 接受

> : 是将 cmd.exe 输入的数据输入到 2.txt 中正如 printf()

还可以将cmd内容输出到文本例如:
cmd 输入输出

就会生成 3.txt:
cmd 输入输出

相关文章:

  • 2021-04-07
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-04-29
  • 2021-09-25
  • 2021-12-15
  • 2021-12-09
相关资源
相似解决方案