#include<iostream>
#include<fstream>
#include<string>
#include<string.h>
using namespace std;
int IsAlpha(char c){//1 yep 0 No
if(((c<='z')&&(c>='a'))||((c<='Z')&&(c>='A')))
return 1;
else return 0;
}
int IsNum(char c){//1 yep 0 No
if(c>='0'&&c<='9')
return 1;
else return 0;
}
int IsBound(char c){
if(c=='('||c==')'||c==','||c==';'||c=='{'||c=='}'){
return 1;
}else return 0;
}
int IsOper(char c){
if(c=='+'||c=='-'||c=='*'||c=='/'||c=='='||c=='>'||c=='<'||c=='!')
return 1;
else return 0;
}
void Scanner(string s){
char p[20];
for(int i=0;i<(s.length()-1);i++)
p[i] = s[i];
for(int i=s.length();i<20;i++)
p[i] = '\0';
cout<<p<<endl;
int f,t;
f=0;//word[0]
t=0;//word[tail]
while(t<=s.length()){
while(f<=t){
if(IsApha())
}
f=t+1;
t=f;
}
};
class ScanF{
};
int main(){
//输入文件路径+名字
cout<<"输入文件路径+名字"<<endl;
string fn;
cin>>fn;
ifstream fin(fn);
if (fin.is_open()){
cout<<"文件读取成功"<<endl;
string line;
while (getline(fin,line)){
cout<<line<<endl;
//Scanner(line);
}
}else cout<<"文件读取失败"<<endl;
return 0;
}
2020-06-25
最新推荐文章于 2020-06-27 17:06:23 发布