diff --git a/Cai_Niao_E_Station/courier.h b/Cai_Niao_E_Station/courier.h new file mode 100644 index 0000000..6f70f09 --- /dev/null +++ b/Cai_Niao_E_Station/courier.h @@ -0,0 +1 @@ +#pragma once diff --git a/Cai_Niao_E_Station/delivery_method.cpp b/Cai_Niao_E_Station/delivery_method.cpp new file mode 100644 index 0000000..2e05bc5 --- /dev/null +++ b/Cai_Niao_E_Station/delivery_method.cpp @@ -0,0 +1,25 @@ +#include +#include +#include "delivery_method.h" +#include "package.h" +#include "user.h" +#include "stock.h" + +class Package; + +Method::Method() { + pkg = new Package; + money = 0; + danger = false; +} + Method::Method(Package* x, double m, bool b) { + pkg = x; + money = m; + danger = b; +} + void Method::fee() { + money = pkg->create_fee(); + } + void Method::set_yndanger(bool flag) { + danger = flag; + } \ No newline at end of file diff --git a/Cai_Niao_E_Station/delivery_method.h b/Cai_Niao_E_Station/delivery_method.h new file mode 100644 index 0000000..e3a2a84 --- /dev/null +++ b/Cai_Niao_E_Station/delivery_method.h @@ -0,0 +1,20 @@ +#pragma once +#include +#include "user.h" +#include "package.h" +#include "stock.h" + +class Package; + +class Method { +private: + Package* pkg; + double money; + bool danger; +public: + Method(); + Method(Package* x, double m, bool b); + void fee(); + void set_yndanger(bool flag); + +}; \ No newline at end of file diff --git a/Cai_Niao_E_Station/exception.cpp b/Cai_Niao_E_Station/exception.cpp new file mode 100644 index 0000000..507983e --- /dev/null +++ b/Cai_Niao_E_Station/exception.cpp @@ -0,0 +1,30 @@ +#include +#include "exception.h" + +using std::cout; +using std::endl; + +/* +std::string Exception::User_Phone_Number_Error() { + return "电话号码不是11位数字,请重新输入!"; +} +std::string Exception::Package_Time_Format_Error() { + return "输入时间格式不正确!请按照2025-05-10-10-05-00的格式输入!"; +} +std::string Exception::Stock_Used_More_Than_All_Error() { + return "货架可存储量大于使用量!请检查输入是否正确!"; +} +*/ +std::runtime_error Etest::User_Phone_Number_Error() { + return std::runtime_error("电话号码不是11位数字,请重新输入!"); +} + +std::runtime_error Etest::Package_Time_Format_Error() +{ + return std::runtime_error("输入时间格式不正确!请按照2025-05-10-10-05-00的格式输入!"); +} + +std::runtime_error Etest::Stock_Used_More_Than_All_Error() +{ + return std::runtime_error("货架可存储量大于使用量!请检查输入是否正确!"); +} diff --git a/Cai_Niao_E_Station/exception.h b/Cai_Niao_E_Station/exception.h new file mode 100644 index 0000000..b8cd7f6 --- /dev/null +++ b/Cai_Niao_E_Station/exception.h @@ -0,0 +1,21 @@ +#pragma once +#include +#include +#include +/* +class Exception { +public: + std::string User_Phone_Number_Error(); + std::string Package_Time_Format_Error(); + std::string Stock_Used_More_Than_All_Error(); + + + +};*/ + +class Etest : public std::runtime_error{ +public: + static std::runtime_error User_Phone_Number_Error(); + static std::runtime_error Package_Time_Format_Error(); + static std::runtime_error Stock_Used_More_Than_All_Error(); +}; \ No newline at end of file diff --git a/Cai_Niao_E_Station/express_comp.h b/Cai_Niao_E_Station/express_comp.h new file mode 100644 index 0000000..6f70f09 --- /dev/null +++ b/Cai_Niao_E_Station/express_comp.h @@ -0,0 +1 @@ +#pragma once diff --git a/Cai_Niao_E_Station/main.cpp b/Cai_Niao_E_Station/main.cpp new file mode 100644 index 0000000..0f27271 --- /dev/null +++ b/Cai_Niao_E_Station/main.cpp @@ -0,0 +1,217 @@ +/* +Developed By + + + ...:::^^^^^^^^^:::.. + .::^^~~~~~~~~~~~~~~~~~^::.. + .:~?JYY?~^~^^^^^^^~~~~~~~~?YYJ?!:. + .:!7!!!7J5!^^^^^^^^^^^^~^!5Y7!!!7!^:. + .:^~~~~^^^^~7^^^^^^^^^^^^^^7!^~~~~~~~~:. + .:~!!^::::::::^^::::::::^^^!!^::::^^^~~~^:. + .:::5GGY. ..::::::^::YGG5. .^^:. + .^:.7YY7:::::::....::..::^..!YY?^:^^:::....^~:. + :~~~^^^^~~^^^:::::......:::^:^^^~~~~~~~~~~~!~^. + .:~~~~~~~~~~^^:::........:::::^^^~~~~~~~~~~~!~^: + .^~~~~~~^^^^^^:::::::::::::::^^^^^~~~~~~~~~~!~^: + .^~~~~~~^^^^^^^::::::::::::^^^^^^^~~~~~~~~~~!~^: + .:~~~~~7!^^^^^^^^^^^:::^^^^^^^^^~~~~~~~7!~~!!~^. + .^~~~~!J!^^^^^^^^^^^^^^^^^^^^~~~~~~~~?J~~!!!~:. + .:^~~~~!Y?~^^~~^^^^^^^^^^^~~~~~~~~~7YJ!~!!!~^. + .:^~~~~~J5J7~~^^^^~~~~~~~~~~~~~!?YY?~~!!!~^. + .:^~~~~~!?Y55J?7!!~~~~~~!77JY55Y7~~!!!~~:. + .:^~~~~~~!7JY555P5555P555Y?7!~~!!!!~^:. + .:^~~!~~~~~~~!!!!!!!!~~~~~!!!!~~^:. + .::^~~!!!!!~~~~~~!!!!!!!!~~^:.. + ..:^^~~~~~~!!!~~~~~^^::.. + ....:::::::::... + +*/ + + + + + + +#include +#include +#include +#include "package.h" +#include "user.h" +#include "stock.h" +#include "delivery_method.h" +#include "exception.h" +#define Endl std::endl +//Exception E; + +Package* k; +User* p; + +std::string Crypt(std::string x, std::string y); + +using std::cin; +using std::cout; +using std::endl; +using std::string; + +extern Stock cainiao[10]; +extern User temp; +extern void PRINT_LIU_YING(); + +int main() { + //先print一下,哈哈 + //PRINT_LIU_YING(); + //初始化人员列表 + p = new User[20]; + p[1].reg("Zhang", "111111198301", "000011"); + p[2].reg("Wang", "12211198301", "000012"); + p[3].reg("Li", "13311198301", "000013"); + p[4].reg("Zhao", "14411198301", "000014"); + p[5].reg("Sun", "15511198301", "000015"); + p[6].reg("Zhou", "16611198301", "000016"); + p[7].reg("Xu", "17711198301", "000017"); + p[8].reg("Wan", "18811198301", "000018"); + p[9].reg("Liu", "19911198301", "000019"); + p[10].reg("Su", "10011198301", "000020"); + p[11].reg("Green", "10111198301", "000021"); + + //测试:检测手机号是否为11位功能 + + /*旧版 + try { + std::string test01, test02, test03; + test01 = "ERROR"; + test02 = "98301"; + test03 = "000022"; + p[12].reg(test01, test02, test03); + if (test02.size() != 11) { + throw E.User_Phone_Number_Error(); + delete &p[12]; + } + } + catch (const std::string& x) { + cout << x << endl; + }*/ + //新版 + try { + std::string test01, test02, test03; + test01 = "ERROR"; + test02 = "98301"; + test03 = "000022"; + p[12].reg(test01, test02, test03); + if (test02.size() != 11) { + throw Etest::User_Phone_Number_Error(); + delete& p[12]; + } + } + catch (const std::runtime_error& x) { + cout << x.what() << endl; + } + + + k = new Package[TOTAL0]; + k[1] = Package("Dildo", "pid1919810", "2025-05-08-00-00-00", "2025-05-09-10-00-00", &temp, 5.4, 10.0, 10.3, false); + k[2] = Package("Clothes", "10002", "2025-05-06-14-15-00", "2025-05-08-11-30-00", &p[2], 1.5, 8.0, 5.6, false); + k[3] = Package("Laptop", "10003", "2025-05-05-10-00-00", "2025-05-06-09-20-00", &p[3], 3.0, 15.0, 20.2, false); + k[4] = Package("Shoes", "10004", "2025-05-07-16-00-00", "2025-05-09-08-00-00", &p[4], 2.8, 9.5, 6.1, false); + k[5] = Package("Snacks", "10005", "2025-05-08-09-45-00", "2025-05-09-14-00-00", &p[5], 1.2, 5.0, 3.7, false); + k[6] = Package("Monitor", "10006", "2025-05-06-11-20-00", "2025-05-07-10-10-00", &p[6], 6.5, 20.0, 18.9, false); + k[7] = Package("Tablet", "10007", "2025-05-07-13-50-00", "2025-05-08-17-00-00", &p[3], 1.8, 14.0, 10.5, false); + k[8] = Package("Camera", "10008", "2025-05-05-07-30-00", "2025-05-06-08-00-00", &p[3], 2.6, 11.0, 9.2, false); + k[9] = Package("Glasses", "10009", "2025-05-06-12-00-00", "2025-05-07-15-30-00", &p[9], 0.8, 4.0, 2.0, false); + k[10] = Package("Headphones", "10010", "2025-05-08-10-00-00", "2025-05-09-13-00-00", &p[10], 1.1, 6.0, 4.4, false); + k[11] = Package("Books", "10011", "2025-05-07-08-30-00", "2025-05-08-10-00-00", &p[1], 2.3, 12.5, 8.0, false); + //测试用户系统 + cout << "Display User :" << endl; + temp.display(); + p[2].display(); + cout << "Alter p2" << Endl; + p[2].alt_name("W.."); + p[2].alt_pn("110"); + p[2].display(); + cout << "测试结束" << endl; + cout << endl; + + //测试包裹存储驿站、超额警报 + cout << "检测: Stock k1 ~ k11 to Stock0, Stock1" << Endl; + cainiao[0].inStock(k[1]); + cainiao[0].inStock(k[2]); + cainiao[0].inStock(k[3]); + cainiao[0].inStock(k[4]); + cainiao[0].inStock(k[5]); + cainiao[0].inStock(k[6]); + cainiao[0].inStock(k[7]); + cainiao[0].inStock(k[8]); + cainiao[0].inStock(k[9]); + cainiao[1].inStock(k[10]); + cainiao[1].inStock(k[11]); + + + cout << "已存入" << Endl; + cout << "展示库存:DisPlay Stock" << Endl; + for (int i = 0;i < 10;i++) { + cout << *(cainiao[0].Check_ProductAll() + i) << " "; + } + cout << Endl; + for (int i = 0;i < 10;i++) { + cout << *(cainiao[1].Check_ProductAll() + i) << " "; + } + cout << endl; + cout << "测试结束" << endl; + + //测试取出包裹的对应 + //k1.display(); + cout << "测试取出包裹的对应" << Endl; + k[1].create_vc(); + string Code = Crypt(temp.Check_uid(), k[1].Check_pid()); + k[1].verifing(Code, "2025-05-10-10-00-00"); + k[1].display(); + cout << endl; + cout << "展示库存变化" << Endl; + for (int i = 0;i < 10;i++) { + cout << *(cainiao[0].Check_ProductAll() + i) << " "; + } + cout << Endl; + for (int i = 0;i < 10;i++) { + cout << *(cainiao[1].Check_ProductAll() + i) << " "; + } + cout << Endl; + + //向空Stock加入包裹(从小往上加) + cout << "测试向空Stock加入包裹(从小往上加)" << endl; + cainiao[0].inStock(k[1]); + for (int i = 0;i < 10;i++) { + cout << *(cainiao[0].Check_ProductAll() + i) << " "; + } + cout << Endl; + for (int i = 0;i < 10;i++) { + cout << *(cainiao[1].Check_ProductAll() + i) << " "; + } + cout << "测试结束" << endl; + cout << Endl; + + //查询用户的包裹 + cout << "测试查询用户包裹" << Endl; + int dw = 3; + cout << " 先展示用户信息" << endl; + p[dw].display(); + cout << "再展示货物信息" << Endl; + k[3].display(); + cout << "下面开始查询" << Endl; + Package* pkgs = p[dw].Check_Package(); + for (int i = 0;i < TOTAL0 - 1;i++){ + if(pkgs[i].Check_pid() != "#UNDEFINED_P:P" ) + cout << pkgs[i].Check_pid() << " "; + + } + cout << Endl; + + //查询包裹状态,拥有者 + k[2].display(); + + + //测试付费系统 + + + cout << "Test Over" << endl; + return 0; +} \ No newline at end of file diff --git a/Cai_Niao_E_Station/package.cpp b/Cai_Niao_E_Station/package.cpp new file mode 100644 index 0000000..448c8ed --- /dev/null +++ b/Cai_Niao_E_Station/package.cpp @@ -0,0 +1,144 @@ +#include +#include +#include "package.h" +#include "user.h" + +extern std::string Crypt(std::string x,std::string y){ + std::string temp; + temp = x; + int t; + t = (int)y[0]; + t /= 5; + for (int i = 0;i < x.size();i++) { + temp[i] += t; + } + return temp; +} + +Package::Package() { + name = "#UNDEFINED_N:P"; + pid = "#UNDEFINED_P:P"; + owner = new User; + jichu_time = "#UNDEINFED_JT:P"; + songda_time = "#UNDEINFED_SD:P"; + quhuo_time = "#UNDEFINED_QH:P"; + is_picked = false; + volume = -1; + mass = -1; + distance = -1; + stockin = NULL; + stock_num = 0; + is_vfast = false; +} +Package::Package(std::string n, std::string pi, std::string j, std::string s, User* o, double v, double m, double d,bool v0) { + //owner = new User; + name = n; + pid = pi; + owner = o; + jichu_time = j; + songda_time = s; + quhuo_time = "#REQUIRD"; + is_picked = false; + volume = v; + distance = d; + mass = m; + is_vfast = v0; + stockin = NULL; + stock_num = 0; +} +//有Bug懒得改了,尽量不用,用Stock里面的inStock +Package& Package::stocked(Stock* x) { + stockin = x; + stock_num = x->Check_used(); + x->inStock(*this); + if (pid == x->Check_Product(x->Check_used())) { + cout << "Successfully Stocked" << endl; + } + else { + cout << "Stock Error! Please Try Again" << endl; + } + return *this; +} + +void Package::create_vc() { + verify_code = Crypt(owner->Check_uid(), pid); + cout << "Verify Code Created" << endl; +} +void Package::verifing(std::string n,std::string time) { + if (verify_code == n) { + quhuo_time = time; + is_picked = true; + stockin->outStock(*this); + return; + } + else { + cout << "Verify Code WRONG!" << endl; + return; + } + if (stockin->Check_Product(stock_num) == "-1") { + cout << "Successfully Picked!" << endl; + } + else { + cout << "Can't Be Selected" << endl; + } +} +Package& Package::alter_stock_num(int n) { + stock_num = n; + return *this; +} +Package& Package::alter_stockin(Stock& x) { + stockin = &x; + return *this; +} + +std::string Package::Check_pid() { + return pid; +} +std::string Package::Check_vc() { + return verify_code; +} +int Package::Check_stock_num() { + return stock_num; +} +User* Package::Check_User() { + return owner; +} +double Package::create_fee() { + double fee; + if (!is_vfast) fee = 5 * mass + 0.5 * volume; + if (is_vfast) fee = 1.3 * (5 * mass + 0.5 * volume); + return fee; +} +Package& Package::operator=(const Package& x) { + name = x.name; + pid = x.pid; + owner = x.owner; + jichu_time = x.jichu_time; + songda_time = x.songda_time; + quhuo_time = x.quhuo_time; + is_picked = x.is_picked; + verify_code = x.verify_code; + volume = x.volume; + mass = x.mass; + distance = x.distance; + is_vfast = x.is_vfast; + stockin = x.stockin; + stock_num = x.stock_num; + return *this; +} + +void Package::display() { + cout << "Package Name : " << name << endl; + cout << "Package Pid : " << pid << endl; + cout << "Package Owner : (Displayed Down)" << endl; + owner->display(); + cout << "Package jichu_time : " << jichu_time << endl; + cout << "Package songda_time : " << songda_time << endl; + cout << "Package quhuo_time : " << quhuo_time << endl; + cout << "Package Picked? : " << is_picked << endl; + cout << "Package Mass : " << mass << endl; + cout << "Package Volume : " << volume << endl; + cout << "Package Distance : " << distance << endl; +} + + diff --git a/Cai_Niao_E_Station/package.h b/Cai_Niao_E_Station/package.h new file mode 100644 index 0000000..fdf470f --- /dev/null +++ b/Cai_Niao_E_Station/package.h @@ -0,0 +1,46 @@ +#pragma once +#include +#include +#include "user.h" +#include "stock.h" + +using std::cin; +using std::cout; +using std::endl; +using std::string; + +class User; +class Stock; + +class Package { +private: + std::string name; + std::string pid;//auto + User* owner; + std::string jichu_time; + std::string songda_time;//time format: 2025-05-08-23-15-03(eazy to cmp and check) + std::string quhuo_time; + bool is_picked; + std::string verify_code; + double volume; + double mass; + double distance; + bool is_vfast; + Stock* stockin; + int stock_num; +public: + Package(); + Package(std::string n, std::string pid, std::string j, std::string s, User* o,double v , double m, double d,bool v0); + void create_vc(); + void verifing(std::string n, std::string time); + std::string Check_pid(); + std::string Check_vc(); + double create_fee(); + int Check_stock_num(); + void display(); + Package& stocked(Stock* x); + Package& alter_stock_num(int n); + Package& alter_stockin(Stock& x); + User* Check_User(); + Package& operator=(const Package& x); +}; \ No newline at end of file diff --git a/Cai_Niao_E_Station/stock.cpp b/Cai_Niao_E_Station/stock.cpp new file mode 100644 index 0000000..484feac --- /dev/null +++ b/Cai_Niao_E_Station/stock.cpp @@ -0,0 +1,97 @@ +#include +#include +#include "stock.h" +#include "user.h" +#include "package.h" + +class Package; + + +int min(int a, int b) { + return a > b ? b : a; +} + + +Stock::Stock() { + all = 10; + used = 0; + for (int i = 0;i < 10;i++) { + pid_code[i] = "-1"; + } +} +Stock::Stock(int a, int l, int* p) { + all = a; + used = l; + for (int i = 0;i < 10;i++) { + pid_code[i] = *(p + i); + } +} +int Stock::Check_used() { + return used; +} +Stock& Stock::inStock(Package& x) { + if (used != ALL0 && all - used > (int)(all * 0.2)) { + int tmp = 0; + for (int i = 0;i < ALL0;i++) { + if (this->pid_code[i] == "-1") { + tmp = i; + break; + } + } + pid_code[tmp] = x.Check_pid(); + x.alter_stock_num(tmp); + x.alter_stockin(*this); + used++; + return *this; + } + else if (all - used <= (int)(all * 0.2)) { + int tmp = 0; + for (int i = 0;i < ALL0;i++) { + if (this->pid_code[i] == "-1") { + tmp = i; + break; + } + } + pid_code[tmp] = x.Check_pid(); + x.alter_stock_num(tmp); + x.alter_stockin(*this); + used++; + this->alert(); + return *this; + } + else { + cout << "This Stock is FULL. Search for Another One" << endl; + return *this; + } + +} +Stock& Stock::outStock(Package& x) { + //用包裹对象取货 + int s = x.Check_stock_num(); + if (s >= 0 && s <= ALL0) { + pid_code[s] = "-1"; + this->refresh(); + } + return *this; +} +//x=pid +Stock& Stock::refresh() { + int cnt = 0; + for (int i = 0;i < ALL0;i++) { + if (pid_code[i] == "-1") { + cnt++; + } + } + cnt = used; + return *this; +} +Stock& Stock::alert() { + cout << "This Stock is ALMOST FULL." << endl; + return *this; +} +std::string Stock::Check_Product(int n) { + return pid_code[n-1]; +} +std::string* Stock::Check_ProductAll() { + return pid_code; +} diff --git a/Cai_Niao_E_Station/stock.h b/Cai_Niao_E_Station/stock.h new file mode 100644 index 0000000..401be2c --- /dev/null +++ b/Cai_Niao_E_Station/stock.h @@ -0,0 +1,33 @@ +#pragma once +#include +#include "user.h" +#include "package.h" +#define USED0 0 +#define ALL0 10 +#define TOTAL0 100 +#define STOCK_NUM 10 +/*默认: +all(这个货架能放几个货物) =10 +used = 0 +后期可在配置文件中调整 +*/ + +class Package; + +class Stock { +private: + int all; + int used; + std::string pid_code[ALL0]; +public: + Stock(); + Stock(int a, int l, int* p); + Stock& inStock(Package& x);//x=pid + //Stock& outStock(std::string x);//x=pid + Stock& refresh(); + Stock& alert(); + int Check_used(); + std::string Check_Product(int n); + std::string* Check_ProductAll(); + Stock& outStock(Package& x); +}; \ No newline at end of file diff --git a/Cai_Niao_E_Station/user.cpp b/Cai_Niao_E_Station/user.cpp new file mode 100644 index 0000000..ea3acce --- /dev/null +++ b/Cai_Niao_E_Station/user.cpp @@ -0,0 +1,135 @@ +#include +#include +#include "package.h" +#include "user.h" +#include "stock.h" + +class Package; +class Stock; + +extern Stock cainiao[STOCK_NUM]; +extern Package* k; + + //Package package_num();//用Package类 + + User::User() { + name = "#UNDEFINED_N"; + phone_num = "#UNDEFINED_P"; + uid = "#UNDEFINED_U"; + jingyan = -1; + } + User::User(std::string n, std::string p, std::string u) { + name = n; + phone_num = p; + uid = u; + jingyan = 0; + } + + + User& User::reg(std::string n, std::string p, std::string u) { + name = n; + phone_num = p; + uid = u; + jingyan = 0; + if (p.size() == 11) cout << n + ", Your are registered!" << endl; + else + { + cout << "Hello " + n + " "; + } + return *this; + } + User& User::alt_name(string n) { + name = n; + cout << "Name altered to " + n << endl; + return *this; + } + User& User::alt_pn(string p) { + phone_num = p; + cout << "Phone Number altered to " + p << endl; + return *this; + } + void User::del() { + name = "#DELETED_" + name; + phone_num = "#DELETED_" + phone_num; + uid = "#DELETED_" + uid; + cout << "User Deleted" << endl; + } + void User::display() { + cout << " Name :" + name << endl; + cout << " Phone Number: " + phone_num << endl; + cout << " uid :" + uid << endl; + } + std::string User::Check_uid() { + return uid; + } + std::string User::Check_name() { + return name; + } + + std::string User::Check_phone() { + return phone_num; + } + User& User::operator=(const User& x) { + name = x.name; + phone_num = x.phone_num; + uid = x.uid; + jingyan = x.jingyan; + return *this; + } + bool User::operator==(const User& x) { + if (name == x.name && + phone_num == x.phone_num && + uid == x.uid && + jingyan == x.jingyan + ) + return true; + else + return false; + } + Package* User::Check_Package() { + Package *tp = new Package [TOTAL0]; + int cnt = 0; + cout << "Chekcing Packages" << endl; + for (int i = 0;i < TOTAL0; i++) { + //extern k[i]的问题,查询系统是正确的 + if (*(k[i].Check_User()) == *this) { + tp[cnt] = k[i]; + //cout << "YES" << endl; + cnt++; + } + } + if (cnt == 0) { + cout << "没有查询到包裹" << endl; + } + return tp; + } + + User& User::add_exp(int s) { + jingyan += s; + return *this; + } + User& User::refresh() { + if (jingyan >= 100) { + VIP* temp = new VIP; + temp->reg(*this); + return *temp; + } + return *this; + } + + + VIP::VIP() { + flag = true; +} + +VIP::VIP(User& x,bool f) : User(x.Check_name(), x.Check_phone(),x.Check_uid()) { + flag = f; +} + +VIP& VIP::reg(User& x){ + flag = true; + return *this; +} +User::~User() { + //delete[] temp; +} \ No newline at end of file diff --git a/Cai_Niao_E_Station/user.h b/Cai_Niao_E_Station/user.h new file mode 100644 index 0000000..fb8cd77 --- /dev/null +++ b/Cai_Niao_E_Station/user.h @@ -0,0 +1,47 @@ +#pragma once +#include +#include +#include "package.h" +#include "stock.h" + +class Package; + +class User { + +private: + std::string name; + std::string phone_num; + //这里先不使用,后面可以直接统计包裹//用Package类 + std::string uid;//外部存储user总数,user的uid最大值 + int jingyan; +public: + User(); + User(std::string n, std::string p, std::string u); + ~User(); + User& reg(std::string n, std::string p, std::string u); + User& alt_name(std::string n); + User& alt_pn(std::string p); + void del(); + std::string Check_uid(); + void display(); + std::string Check_name(); + std::string Check_phone(); + User& add_exp(int s); + User& refresh(); + Package* Check_Package(); + User& operator=(const User& x); + bool operator==(const User& x); +}; + +class VIP : public User { +private: + //std::string name; + //std::string phone_num; + //std::string uid; + //int jingyan; + bool flag; +public: + VIP(); + VIP(User& x, bool f); + VIP& reg(User& x); +}; \ No newline at end of file diff --git a/Cai_Niao_E_Station/variable.cpp b/Cai_Niao_E_Station/variable.cpp new file mode 100644 index 0000000..105e4cc --- /dev/null +++ b/Cai_Niao_E_Station/variable.cpp @@ -0,0 +1,23 @@ +#include +#include +#include "package.h" +#include "stock.h" +#include "user.h" +#include + +class User; + +Stock cainiao[STOCK_NUM]; +User temp("Van", "110", "uid114514"); + +std::string LIU_YING = "GGGGGGGGGGGGGGGGGGGGGGGGP555555J7!!!7???7!!!!!!!7777!!!!!!!~~!!7?JYYY?~7JJYPGGPPPPPPPPPP555555YYJ?7!\nGGGGGGGGGGGGGGGGGGGGGG5555555Y ? !!7JY ? 7!!!!!!!7777!!!!!!!~~!7JJJJJJ ? ? JYJ!77!!? 5PGPPPPPPPPP55555YYJ ? !~\nGGGGGGGGGGGGGGGGGGGGP5555555YJ ? ? YY ? !!!!!!!!!7!!!!!!!!!!7JPGBBPYJJJJJJ ? ? 7~7JJ7 ^ !YGGPPPPPPPPP5555YYJ7!\nGGGGGGGGGGGGGGGGGGG555555555P55Y ? !!!!!!!!!!!!!!!!!!!!? 5GBBBBBBGYYY5GBBGP5J ? J5 ? ^ ^!5GGGPPPPPPP5555YYJ ? \nGGGGGGGGGGGGGGGGGG55555555PPPY ? !~~~~!!!~~~~!!!!!!!7JGBBBBBBGP5YYYYYPGBBBBGPJ7Y!~~^ ? PGGGPPPPPP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JYJJYPYJJYJJJYY!~~~~~~~~? !~~^ .7\nGB#BGB##B###BBBBBBGGGGPGGGGGPP5YYYJ75BBBGPBGGPG ? !YGGGGGGPJYYJY55555 ? 7Y55J77JYYY ? 7 ? J7!!!!!!!~~~~~~^ . ? \nBBBGBB##GB##BBBBBBBBBBGGGPYJJJJJJY55GBBBGGBGGPY~!GGGGGGGGPYJYJ ? J5PPPYPGGG5777YYYYY ? !~~~~~~~~~~~~~::P\n"; + +//PRINT_LIUYING_ONE_BY_ONE + +void PRINT_LIU_YING() { + std::string temp001 = LIU_YING; + for (int i = 0;i < temp001.size();i++) { + cout << temp001[i]; + Sleep(10); + } +} diff --git a/Cai_Niao_E_Station/variable.h b/Cai_Niao_E_Station/variable.h new file mode 100644 index 0000000..6f70f09 --- /dev/null +++ b/Cai_Niao_E_Station/variable.h @@ -0,0 +1 @@ +#pragma once