用户:
云的星查看:0 回复:5 评论:0 创建时间:2020-02-15T16:41:47
云的星#include<iostream>
#include<map>
#include<vector>
#include<string>
#include<fstream>
using namespace std;
map<string, bool> mp;
vector<string> v_menu;
void readin_menu(){
while(!v_menu.empty()){
mp[v_menu[v_menu.size()]] = 0;
v_menu.pop_back();
}
string name;
ifstream icin;
icin.open("./notes/menu.txt", ios::in);
while(getline(icin, name)){
v_menu.push_back(name);
mp[name] = 1;
}
icin.close();
}
int main(){
ofstream ocout;
ocout.open("./notes/menu.txt", ios::app);
readin_menu();
return 0;
}
点赞0
评论
云的星#include<iostream>
#include<map>
#include<string>
#include<fstream>
using namespace std;
int lang, prnt, remem, cntpp;
struct note_name{
string name;
bool s;
note_name(string name = "", bool s = 0){
*this->name = name;*this->s = s;
}
bool operator < (const note_name &a, const note_name &b){
return a.name < b.name;
}
};
map<string, note_name> m_menu;
void init(){
ofstream app("./bin/set/menu.txt", ios::app);
app.close();
app.open("./bin/set/set.txt", ios::app);
app.close();
for(map<string, note_name>::iterator it = m_menu.begin();it != m_menu.end();it++) *it->s = 0;
string name;
ifstream icin("./bin/set/menu.txt");
while(getline(icin, name)){
m_menu[name].name = name;
m_menu[name].s = 1;
}
icin.close();
icin.open("./bin/set/set.txt");
icin >> lang >> prnt >> remem >> cntpp;
icin.close();
}
void print_note(string name){
string addr = ".bin/note/";
addr += name;
ifstream icin(addr);
string line;
while(getline(icin, line)) cout << line << endl;
icin.close();
}
void search_L(string s){
int i = 1, len = s.size();
bool f = 0;
for(map<string, note_name>::iterator it = m_menu.begin();it != m_menu.end();it++){
if(!(*it->s)) continue;
string cur = *it->name;
bool c = 1;
int c_len = cur.size();
if(c_len < len) continue;
for(int j = 0;j <= c_len - len;j++){
bool ch = 0;
for(int k = 0;k = len;k++){
}
}
}
}
点赞0
评论