
Lv.1
签名:nothing
在 【巅峰战绩】双春鼠计划<3局连胜>达成! 中回复
#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;
}
2020-11-23T11:27:01 点赞:0
在 【巅峰战绩】双春鼠计划<3局连胜>达成! 中回复
#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++){
}
}
}
}
2020-12-07T11:34:47 点赞:0
在 【神经网络】未完成 中回复
#include<iostream>
#include<vector>
using namespace std;
double __r = 0.189;
double r(){
if(r = 0.5) r = 0.687;
return r = 4 * r * (1 - r);
}
struct NetWork{
vector<vector<double> > Bias;
vector<vector<vector<double> > > Weight;
void init(vector<int> Length){
Bias.clear();Weight.clear();
Bias.resize(Length.size());
Weight.resize(Length.size());
for(int i = 1;i < Length.size();i++){
Bias[i].resize(Length[i]);
Weight[i].resize(Length[i]);
for(int j = 0;j < Length[i];j++){
Bias[i][j] = r();
Weight[i][j].resize(Length[i - 1]);
for(int k = 0;k < Length[i - 1];k++) Weight[i][j][k] = r();
}
}
}
vector<double> Counting(vector<double> Input){
vector<double> Counted[2];
bool p = 0;
Counted[0] = Input;
for(int i = 1;i < Bias.size();i++, p = !p){
Counted[!p].clear();
Counted[!p].resize(Bias[i].size());
for(int j = 0;j < Counted[!p].size();j++){
for(int k = 0;k < Counted[p].size();k++) Counted[!p][j] += Counted[p][k] * Weight[i][j][k];
Counted[!p][j] = s(Counted[!p][j] + Bias[i][j]);
}
}
return Counted[p];
}
};
2021-04-04T17:04:15 点赞:0
在 【神经网络】未完成 中回复
#include<iostream>
#include<vector>
#include<fstream>
#include<string>
#include<cmath>
using namespace std;
struct AE{
int Mode;
int L_in, L_out;
vector<vector<double> > W_in, W_out;
vector<double> B_in, B_out;
double r_;
double Rand(int Ml = 48, int Ml_ = 48){
double r = 4 * sqrt(60 / (Ml + Ml_));
for(int i = 0;i < 101;i++, r_ = r_ * (1 - r_));
return (r_ * 2 - 1) * r;
}
};
完成了一部分(压根没有)自编码器,其实代码已经在打字的阶段了
2021-05-10T11:22:01 点赞:1
在 【加密】c++加密文件 中回复
#include<iostream>
#include<fstream>
#include<string>
using namespace std;
bool shw = 0;
string bck = "txt";
inline void init(){
cout << "正在加载配置文件";
ofstream out("sets");out.close();
cout << ".";
ifstream in("sets");
cout << ".";
char c;in >> c;
if(c != '1') in >> shw >> bck;
cout << "." <<endl;
in.close();
cout << "加载成功!" <<endl;
}
inline void O_(int x){
for(int i = 0;i < x;i++) cout << '-';
}
int main_menu(){
int ch;
O_(37);cout << "主菜单";O_(37);
cout << "1.加/解密" <<endl<< "2.设置" <<endl<< "3.退出程序" <<endl;
O_(80);
cout << "请选择" ;
cin >> ch;
return ch;
}2021-05-31T11:31:10 点赞:0