2020-06-25

#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;

}
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值