📄 cifa.cpp
字号:
#include <stdio.h>
#include <string.h>
#include <process.h>
#define MAX 50
void main()
{
FILE *in,*out;/*存放输入字符串和输出单词串的文件*/
char arr[MAX];/*arr数组存放单词符号*/
char currentchar;/*currentchar存放当前输入字符*/
int i=0;/*arr数组的一个指针*/
/*以读方式打开输入文件*/
if((in=fopen("infile.txt","r"))==NULL)
{
printf("can not open file\n");
exit(0);
}
/*以写方式打开输出文件*/
if((out=fopen("outfile.txt","w"))==NULL)
{
printf("cannout open outfile\n");
exit(1);
}
//去掉开头空格
currentchar=fgetc(in);
while(currentchar==' ')
{
currentchar=fgetc(in);
}
int ch;
while(currentchar!='@')//结束符号
{
/*常数部分判断*/
if((currentchar>='a'&¤tchar<='z')||(currentchar>='A'&¤tchar<='Z')||
(currentchar>='0'&¤tchar<='9')||currentchar=='('||currentchar==')'||
currentchar=='{'||currentchar=='}'||currentchar=='>'||currentchar=='<'||
currentchar==';'||currentchar==':'||currentchar=='+'||currentchar=='-'||
currentchar=='*'||currentchar=='/'||currentchar=='='||currentchar=='!'||
currentchar=='&'||(ch=currentchar)=='\n'||currentchar==' '||currentchar=='['||currentchar==']')
{
i=0;//清空arr字符数
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -