当前位置: 首页 > news >正文

常州 网站优化电商行业的8种运营模式

常州 网站优化,电商行业的8种运营模式,织梦单页面网站模板,新手电商如何入门功能分析 生词本管理#xff1a; 创建生词本文件#xff1a;在构造函数中创建了“生词本.txt”“背词历史.log”“历史记录.txt”三个文件。添加单词#xff1a;用户可以输入单词、词性和解释#xff0c;将其添加到生词本中。查询所有单词#xff1a;展示生词本中所有的单…功能分析 生词本管理 创建生词本文件在构造函数中创建了“生词本.txt”“背词历史.log”“历史记录.txt”三个文件。添加单词用户可以输入单词、词性和解释将其添加到生词本中。查询所有单词展示生词本中所有的单词、词性和翻译。精确查词用户可以选择按照单词、词性或中文解释进行查词并显示查询结果。删除单词根据用户输入删除生词本中的特定单词。背词功能 背生词从生词本中读取单词进行背诵背诵完成后将生词从生词本中删除并将相关信息添加到背词历史中。历史记录查询 根据时间查历史记录用户输入年月日查询该日期的背词历史记录并将其保存到历史记录文件中。查询历史背词展示历史记录文件中的内容。其他功能 更新日志输出新增功能的说明。总的服务界面提供菜单界面用户根据序号选择相应的服务。 详细代码 #include iostream #include fstream #include string #include sstream #include iomanip //输出控制头文件1 #include time.h #include windows.husing namespace std;class Recite {fstream file;fstream file1; public:Recite(); //创建生词本文件void insert_word(); //添加单词void query_all(); //查询所有单词void query_by_time();//根据时间查历史记录void query_history();//查询历史背词void query_exact(); //精确查词void delete_word(); //删除单词int get_num(); //返回生词本中单词的数量void recite_word(); //背生词void update_log(); //更新日志void run(); //总的服务界面 };Recite::Recite() {file.open(生词本.txt);file.close();file.open(背词历史.log);file.close();file.open(历史记录.txt);file.close(); }void Recite::insert_word() {clock_t startTime, endTime;file.open(生词本.txt, ios::out | ios::app); //在文件末尾处写入if (file.is_open() 1) {//打开成功的话startTime clock();char word[20], cha[5], trans[20]; //单词 词性 解释cout 请输入要写入错题本的单词;cin word;cout 请输入单词的词性;cin cha;cout 请输入单词的解释;cin trans;file word cha trans endl; //1就代表没有被删除的单词file.close();endTime clock();cout 写入成功总共用时 (double) (endTime - startTime) / CLOCKS_PER_SEC s endl;} else {cout 打开文件失败 endl;system(pause);}}void Recite::query_all() {clock_t startTime, endTime;startTime clock();char buffer[100];int number 0; //记录记录的条数cout --------------------- endl;cout | setw(8) 单词;cout | setw(4) 词性;cout | setw(8) 翻译;cout | endl;cout --------------------- endl;file.open(生词本.txt, ios::in | ios::app);while (!file.eof()) {file.getline(buffer, 100);istringstream is(buffer);string s1, s2, s3, s4;is s1 s2 s3 s4;if (s1 ! s2 ! s3 ! ) {number;cout | setw(8) s1;cout | setw(4) s2;cout | setw(8) s3;cout | endl;cout --------------------- endl;}}endTime clock();cout 总共有 number 条记录总共用时 (double) (endTime - startTime) / CLOCKS_PER_SEC s endl;file.close(); }void Recite::query_by_time() {file.open(背词历史.log, ios::in | ios::out | ios::app);if (file.is_open()) {string time;cout 请输入要查询的历史记录的年月日格式为年-月-日;cin time;string word[100], cha[100], trans[100];int i 0;char buffer[100];while (!file.eof()) {file.getline(buffer, 100);istringstream is(buffer);string t1, t2;is t1 t2;if (t1 time) {while (!file.eof()) {file.getline(buffer, 100);istringstream input(buffer);string s1, s2, s3;input s1 s2 s3;if (s1 ! s2 ! s3 ! ) {word[i] s1;cha[i] s2;trans[i] s3;i;} else {if (s1 time)continue;elsebreak;}}}}file.close();file.open(历史记录.txt, ios::in | ios::out | ios::trunc);for (int j 0; j i; j)file word[j] cha[j] trans[j] endl;file.close();query_history();} else {cout 文件打开失败 endl;return;} }void Recite::query_history() {clock_t startTime, endTime;startTime clock();char buffer[100];int number 0; //记录记录的条数cout --------------------- endl;cout | setw(8) 单词;cout | setw(4) 词性;cout | setw(8) 翻译;cout | endl;cout --------------------- endl;file.open(历史记录.txt, ios::in | ios::app);while (!file.eof()) {file.getline(buffer, 100);istringstream is(buffer);string s1, s2, s3, s4;is s1 s2 s3 s4;if (s1 ! s2 ! s3 ! ) {number;cout | setw(8) s1;cout | setw(4) s2;cout | setw(8) s3;cout | endl;cout --------------------- endl;}}endTime clock();cout 总共有 number 条记录总共用时 (double) (endTime - startTime) / CLOCKS_PER_SEC s endl;file.close(); }void Recite::query_exact() {clock_t startTime, endTime;char buffer[100];int i, number 0;cout 1.按照单词查词 endl;cout 2.按照词性查词 endl;cout 3.按照中文解释查词 endl;cout 请输入需要确定查词方式;cin i;startTime clock();string word;cout 请输入要查的单词;cin word;cout --------------------- endl;cout | setw(8) 单词;cout | setw(4) 词性;cout | setw(8) 翻译;cout | endl;cout --------------------- endl;file.open(生词本.txt, ios::in);switch (i) {case 1:while (!file.eof()) {file.getline(buffer, 100);istringstream is(buffer);string s1, s2, s3;is s1 s2 s3;if (s1 word) {number;cout | setw(8) s1;cout | setw(4) s2;cout | setw(8) s3;cout | endl;cout --------------------- endl;}}endTime clock();cout 查询成功一共有 number 条记录用时 (double) (endTime - startTime) / CLOCKS_PER_SEC s endl;file.close();break;case 2:while (!file.eof()) {file.getline(buffer, 100);istringstream is(buffer);string s1, s2, s3;is s1 s2 s3;if (s2 word) {number;cout | setw(8) s1;cout | setw(4) s2;cout | setw(8) s3;cout | endl;cout --------------------- endl;}}endTime clock();cout 查询成功一共有 number 条记录用时 (double) (endTime - startTime) / CLOCKS_PER_SEC s endl;file.close();break;case 3:while (!file.eof()) {file.getline(buffer, 100);istringstream is(buffer);string s1, s2, s3;is s1 s2 s3;if (s3 word) {number;cout | setw(8) s1;cout | setw(4) s2;cout | setw(8) s3;cout | endl;cout --------------------- endl;}}endTime clock();cout 查询成功一共有 number 条记录用时 (double) (endTime - startTime) / CLOCKS_PER_SEC s endl;file.close();break;default://默认用单词查询while (!file.eof()) {file.getline(buffer, 100);istringstream is(buffer);string s1, s2, s3;is s1 s2 s3;if (s1 word) {number;cout | setw(8) s1;cout | setw(4) s2;cout | setw(8) s3;cout | endl;cout --------------------- endl;}}endTime clock();cout 查询成功一共有 number 条记录用时 (double) (endTime - startTime) / CLOCKS_PER_SEC s endl;file.close();break;} }int Recite::get_num() {file1.open(生词本.txt, ios::in); //以只读方式打开生词本char buffer[100];int number 0;while (!file.eof()) {file.getline(buffer, 100);istringstream is(buffer);string s1, s2, s3;is s1 s2 s3;if (s1 ! s2 ! s3 ! )number;}file1.close();return number; }void Recite::delete_word() {query_all(); //显示所有的记录string str;clock_t startTime, endTime;cout 请输入想要删除的单词;cin str;startTime clock();file.open(生词本.txt, ios::in);char buffer[100];string str1[100], str2[100], str3[100];int i 0;while (!file.eof()) {file.getline(buffer, 100);istringstream is(buffer);string s1, s2, s3;is s1 s2 s3;if (s1 ! str s1 ! s2 ! s3 ! ) {str1[i] s1;str2[i] s2;str3[i] s3;i;}}file.close();file.open(生词本.txt, ios::out | ios::trunc); //以截断方式打开文件清空所有内容for (int j 0; j i; j) {file str1[j] str2[j] str3[j] endl;}file.close();endTime clock();cout 删除成功用时 (double) (endTime - startTime) / CLOCKS_PER_SEC s endl; }void Recite::recite_word() {file.open(生词本.txt, ios::in | ios::out);if (file.is_open() 1) {clock_t startTime, endTime;//遍历后将单词拷贝至内存string word[100], cha[100], trans[100], str;char buffer[100];int i 0;while (!file.eof()) {file.getline(buffer, 100);istringstream is(buffer);string s1, s2, s3;is s1 s2 s3;if (s1 ! s2 ! s3 ! ) {word[i] s1;cha[i] s2;trans[i] s3;i;}}int number i;cout 本次需要复习的单词数量是 number endl;system(pause);system(cls);int num_of_recite[100]; //记录需要背诵单词的次数一开始都是1for (int k 0; k 100; k)num_of_recite[k] 1;int sucessful 0; //判断单词是否背完了背完了就是1没有背完就是0if (number 0)sucessful 1;int num 0;startTime clock();while (sucessful 0) {for (int j 0; j i; j) {if (num_of_recite[j] ! 0) {cout 中文意思 trans[j] cha[j] endl;cout 请输入单词;cin str;if (str word[j]) {cout 正确;num_of_recite[j]--;system(pause);system(cls);num;if (num number)sucessful 1;} else {cout 错误正确答案是 word[j];num_of_recite[j];system(pause);system(cls);}}}}endTime clock();cout 恭喜你背完啦~~用时 (double) (endTime - startTime) / CLOCKS_PER_SEC s endl;//背完单词后清空单词表file.close();file.open(生词本.txt, ios::out | ios::trunc);file.close();//然后写入日志file.open(背词历史.log, ios::out | ios::app);SYSTEMTIME st {0};GetLocalTime(st);file st.wYear - st.wMonth - st.wDay st.wHour : st.wMinute : st.wSecond endl;for (int j 0; j i; j) {file word[j] cha[j] trans[j] endl;}file.close();} else {cout 生词表为空先加入生词再背诵吧 endl;return;} }void Recite::update_log() {cout 新增的内容 endl;cout 1.新增背词功能在背诵完生词后生词会自动从生词表删除并且添加到背词历史中 endl;cout 2.新增历史生词查询功能可以根据当天的年与日查询背诵完的生词 endl; }void Recite::run() {cout ------------------------------ endl;cout |欢迎使用大家一起背单词 | endl;cout |1.添加生词 | endl;cout |2.显示所有生词 | endl;cout |3.精确查词 | endl;cout |4.删除生词表中的词 | endl;cout |5.背生词 | endl;cout |6.查询背诵历史 | endl;cout |7.更新日志 | endl;cout |8.退出 | endl;cout ------------------------------ endl;cout 请输入需要服务的序号;int i;cin i;while (i ! 8) {switch (i) {case 1:system(cls);insert_word();break;case 2:system(cls);query_all();break;case 3:system(cls);query_exact();break;case 4:system(cls);delete_word();break;case 5:system(cls);recite_word();break;case 6:system(cls);query_by_time();break;case 7:system(cls);update_log();break;case 8:break;default:cout 对应数字的服务不存在请重新输入 endl;break;}system(pause);system(cls);cout ------------------------------ endl;cout |欢迎使用背词宝version1.1 | endl;cout |1.添加生词 | endl;cout |2.显示所有生词 | endl;cout |3.精确查词 | endl;cout |4.删除生词表中的词 | endl;cout |5.背生词 | endl;cout |6.查询背诵历史 | endl;cout |7.更新日志 | endl;cout |8.退出 | endl;cout ------------------------------ endl;cout 请输入需要服务的序号;cin i;} }int main() {Recite r;r.run();return 0; }
http://www.w-s-a.com/news/187605/

相关文章:

  • 商标做网站logo建网站作业
  • 网站顶部展出的大幅广告中建八局第二建设有限公司
  • 公众微信绑定网站帐号优秀中文网页设计
  • 如何做漫画赚钱的网站企业网站管理系统c
  • 安康公司网站制作搜狗网站
  • 太仓住房与城乡建设局网站注册推广赚钱一个80元
  • wordpress 网站生成app企业网站改版的好处
  • 广州建站服务怎么让客户做网站
  • 南京手机网站设计公司wordpress导航页
  • 娄底市建设网站app网站开发小程序
  • 刷粉网站推广免费网站建设找王科杰信誉
  • 投标建设用地是哪个网站微信小程序多少钱
  • 做玄幻封面素材网站我国数字经济报告
  • 手机网站返回跳转wordpress带颜色的文字
  • 微信群领券网站怎么做创意广告图片
  • 跟我一起做网站嘉兴做网站哪家好
  • 上海知名建站公司山东住房和建设庭网站
  • 深圳市城乡建设部网站首页平台设计方案怎么做
  • 深圳美食教学网站制作wordpress列表图显示标题
  • 怎么做网址导航网站沈阳高端做网站建设
  • 棋牌网站开发需要多少钱整网站代码 带数据 免费 下载
  • 网站建设 sql 模版猎头用什么网站做单
  • 河北保定建设工程信息网站wordpress 远程缓存
  • 手机网站开发之列表开发win7网站开发教程
  • 楚雄市住房和城乡建设局网站廊坊企业网站建设
  • 东莞规划局官方网站wordpress添加文章页不显示图片
  • 做企业网站要哪些人员百度商城网站建设
  • c语言软件开和网站开发区别多产品的网站怎么做seo
  • 收益网站制作移动互联网应用的使用情况表格
  • 专业的手机网站建设公司哪家好同城信息网站建设