write.cpp
来自「数值计算」· C++ 代码 · 共 24 行
CPP
24 行
#include "stdio.h"
#include "fstream.h"
#include "conio.h"
#include "iostream.h"
#include "process.h"
void main()
{
FILE *fp;
char str;
printf("Please input some words:\n");
if((fp = fopen("2.txt","w")) == NULL)
{
printf("File cannot be created!\n");
exit(1);
}
while((str = fgetc(stdin)) !='#')
fputc(str,fp);
fclose(fp);
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?