#include <stdio.h>
#include <stdlib.h>
int main()
{
FILE * outfile;
char ch[81];
int i;
outfile = fopen("newChar.txt", "w");
if (outfile == NULL)
{
printf("无法创建文件!");
exit(0);
}
printf("请输入一个字符串:");
fgets(ch, 81, stdin);
for (i = 0; ch[i] != '\n' || '\0'; i++)
fprintf(outfile, "%c\n", ch[i]);
fclose(outfile);
return 0;
}