网站后台挂马怎么处理wordpress 淘宝客源码

张小明 2026/1/10 6:04:53
网站后台挂马怎么处理,wordpress 淘宝客源码,系统建设方案怎么写,wordpress媒体库图片显示不出来课程目标 理解数组的概念和用途掌握一维数组的定义、初始化和访问学会数组遍历和经典应用掌握字符串的基本操作理解批量数据处理的思想为后续算法学习打下基础 第一部分#xff1a;数组的概念#xff08;40分钟#xff09; 1.1 什么是数组#xff1f; 生活比喻#xff…课程目标理解数组的概念和用途掌握一维数组的定义、初始化和访问学会数组遍历和经典应用掌握字符串的基本操作理解批量数据处理的思想为后续算法学习打下基础第一部分数组的概念40分钟1.1 什么是数组生活比喻储物柜一排编号的储物格每个格子可以放东西学生座位表按学号排列的座位每个位置坐一个学生火车车厢连续的车厢每节车厢有编号和乘客1.2 为什么需要数组没有数组的困境// 要存储5个学生的成绩intscore1,score2,score3,score4,score5;cinscore1score2score3score4score5;// 要计算平均分doubleaverage(score1score2score3score4score5)/5.0;// 如果要处理100个学生呢需要100个变量使用数组的便利// 使用数组存储5个学生的成绩intscores[5];for(inti0;i5;i){cinscores[i];}// 计算平均分intsum0;for(inti0;i5;i){sumscores[i];}doubleaveragesum/5.0;1.3 数组的特点相同类型数组中所有元素的数据类型相同连续存储元素在内存中连续存放固定大小数组一旦创建大小不能改变索引访问通过下标索引访问元素第二部分一维数组的基本操作60分钟2.1 数组的定义和初始化定义数组数据类型 数组名[数组大小];示例#includeiostreamusingnamespacestd;intmain(){// 定义数组的不同方式intnumbers1[5];// 定义包含5个整数的数组未初始化intnumbers2[5]{1,2,3,4,5};// 定义并初始化intnumbers3[]{1,2,3,4,5};// 自动推断大小为5intnumbers4[5]{1,2};// 前两个元素初始化其余为0// 访问数组元素numbers1[0]10;// 给第一个元素赋值coutnumbers2[2]endl;// 输出第三个元素3return0;}2.2 数组的访问和遍历数组索引索引从0开始不是从1开始有效索引范围0 到 数组大小-1访问越界是常见错误#includeiostreamusingnamespacestd;intmain(){intscores[5]{85,92,78,96,88};// 逐个访问cout第一个学生成绩: scores[0]endl;cout第三个学生成绩: scores[2]endl;// 使用循环遍历数组cout所有成绩: ;for(inti0;i5;i){coutscores[i] ;}coutendl;// 修改数组元素scores[1]95;// 修改第二个学生的成绩cout修改后的第二个成绩: scores[1]endl;return0;}2.3 数组大小和边界检查#includeiostreamusingnamespacestd;intmain(){constintSIZE5;// 使用常量定义数组大小intnumbers[SIZE]{10,20,30,40,50};// 正确遍历cout正确遍历: ;for(inti0;iSIZE;i){coutnumbers[i] ;}coutendl;// 错误访问越界危险// cout numbers[5] endl; // 索引5不存在// cout numbers[-1] endl; // 索引-1不存在// 使用sizeof计算数组大小intbyteSizesizeof(numbers);// 整个数组的字节数intelementSizesizeof(numbers[0]);// 每个元素的字节数intelementCountbyteSize/elementSize;// 元素个数cout数组总字节数: byteSizeendl;cout每个元素字节数: elementSizeendl;cout元素个数: elementCountendl;return0;}第三部分数组的经典应用80分钟3.1 求最大值和最小值#includeiostreamusingnamespacestd;intmain(){constintSIZE7;inttemperatures[SIZE]{25,28,30,22,26,29,27};// 找最高温度intmaxTemptemperatures[0];// 假设第一个是最大值for(inti1;iSIZE;i){if(temperatures[i]maxTemp){maxTemptemperatures[i];}}// 找最低温度intminTemptemperatures[0];// 假设第一个是最小值for(inti1;iSIZE;i){if(temperatures[i]minTemp){minTemptemperatures[i];}}cout一周温度: ;for(inti0;iSIZE;i){couttemperatures[i]°C ;}coutendl;cout最高温度: maxTemp°Cendl;cout最低温度: minTemp°Cendl;return0;}3.2 求和与平均值#includeiostreamusingnamespacestd;intmain(){constintSIZE5;doubleexpenses[SIZE]{45.5,28.0,63.2,19.8,52.1};// 计算总支出doubletotal0;for(inti0;iSIZE;i){totalexpenses[i];}// 计算平均支出doubleaveragetotal/SIZE;// 找出高于平均值的支出cout所有支出: ;for(inti0;iSIZE;i){coutexpenses[i]元 ;}coutendl;cout总支出: total元endl;cout平均支出: average元endl;cout高于平均值的支出: ;for(inti0;iSIZE;i){if(expenses[i]average){coutexpenses[i]元 ;}}coutendl;return0;}3.3 计数和统计#includeiostreamusingnamespacestd;intmain(){constintSIZE10;intscores[SIZE]{85,92,78,45,96,88,62,75,91,53};intexcellent0;// 优秀90-100intgood0;// 良好80-89intpass0;// 及格60-79intfail0;// 不及格0-59// 统计各个等级的人数for(inti0;iSIZE;i){if(scores[i]90){excellent;}elseif(scores[i]80){good;}elseif(scores[i]60){pass;}else{fail;}}cout成绩统计结果:endl;cout优秀90-100: excellent人endl;cout良好80-89: good人endl;cout及格60-79: pass人endl;cout不及格0-59: fail人endl;// 计算百分比cout优秀率: (excellent*100.0/SIZE)%endl;cout及格率: ((excellentgoodpass)*100.0/SIZE)%endl;return0;}3.4 数组排序选择排序#includeiostreamusingnamespacestd;intmain(){constintSIZE6;intnumbers[SIZE]{64,25,12,22,11,5};cout排序前: ;for(inti0;iSIZE;i){coutnumbers[i] ;}coutendl;// 选择排序算法for(inti0;iSIZE-1;i){// 找到从i到末尾的最小元素的索引intminIndexi;for(intji1;jSIZE;j){if(numbers[j]numbers[minIndex]){minIndexj;}}// 交换当前元素和最小元素inttempnumbers[i];numbers[i]numbers[minIndex];numbers[minIndex]temp;// 显示每一轮排序的结果cout第i1轮: ;for(intk0;kSIZE;k){coutnumbers[k] ;}coutendl;}cout排序后: ;for(inti0;iSIZE;i){coutnumbers[i] ;}coutendl;return0;}3.5 数组搜索#includeiostreamusingnamespacestd;intmain(){constintSIZE8;intnumbers[SIZE]{23,45,67,12,89,34,56,78};inttarget;cout数组内容: ;for(inti0;iSIZE;i){coutnumbers[i] ;}coutendl;cout请输入要查找的数字: ;cintarget;// 线性搜索boolfoundfalse;intposition-1;for(inti0;iSIZE;i){if(numbers[i]target){foundtrue;positioni;break;// 找到后立即退出循环}}if(found){cout找到了数字 target 在数组中的位置是: positionendl;}else{cout没有找到数字 targetendl;}return0;}第四部分字符串基础60分钟4.1 什么是字符串字符串的概念字符串是字符的序列在C中字符串可以用字符数组或string类表示字符串以空字符\0结尾4.2 字符数组表示字符串#includeiostreamusingnamespacestd;intmain(){// 方式1字符数组C风格字符串charstr1[6]{H,e,l,l,o,\0};charstr2[]Hello;// 自动添加\0charname[20];coutstr1: str1endl;coutstr2: str2endl;// 输入字符串cout请输入你的名字: ;cinname;cout你好, name!endl;// 遍历字符数组cout字符串字符: ;for(inti0;str2[i]!\0;i){coutstr2[i] ;}coutendl;return0;}4.3 string类的基本使用#includeiostream#includestring// 必须包含string头文件usingnamespacestd;intmain(){// string类的定义和初始化string str1Hello;stringstr2(World);string str3;// 字符串赋值str3C;// 字符串连接string greetingstr1 str2!;coutgreetingendl;// 字符串输入string name;cout请输入你的全名: ;cinname;// 遇到空格停止cout你好, name!endl;// 使用getline读取整行cin.ignore();// 清除之前的换行符cout请重新输入你的全名: ;getline(cin,name);cout你好, name!endl;return0;}4.4 字符串常用操作#includeiostream#includestringusingnamespacestd;intmain(){string textHello C Programming;// 字符串长度cout字符串: textendl;cout长度: text.length()endl;// 访问单个字符cout第一个字符: text[0]endl;cout最后一个字符: text[text.length()-1]endl;// 字符串比较string str1apple;string str2banana;if(str1str2){coutstr1 等于 str2endl;}elseif(str1str2){coutstr1 在 str2 前面endl;}else{coutstr1 在 str2 后面endl;}// 子字符串string substringtext.substr(6,3);// 从位置6开始取3个字符cout子字符串: substringendl;// 查找子字符串intpositiontext.find(C);if(position!string::npos){cout找到 C 在位置: positionendl;}else{cout没有找到 Cendl;}return0;}第五部分字符串应用示例60分钟5.1 字符串统计#includeiostream#includestringusingnamespacestd;intmain(){string text;cout请输入一段文本: ;getline(cin,text);intletterCount0,digitCount0,spaceCount0,otherCount0;// 统计各种字符的个数for(inti0;itext.length();i){charchtext[i];if((chachz)||(chAchZ)){letterCount;}elseif(ch0ch9){digitCount;}elseif(ch ){spaceCount;}else{otherCount;}}cout\n 字符统计结果 endl;cout总字符数: text.length()endl;cout字母个数: letterCountendl;cout数字个数: digitCountendl;cout空格个数: spaceCountendl;cout其他字符: otherCountendl;return0;}5.2 字符串反转#includeiostream#includestringusingnamespacestd;intmain(){string str;cout请输入一个字符串: ;getline(cin,str);cout原始字符串: strendl;// 方法1创建新字符串string reversed1;for(intistr.length()-1;i0;i--){reversed1str[i];}cout反转字符串(方法1): reversed1endl;// 方法2原地反转string reversed2str;// 复制原字符串intleft0,rightreversed2.length()-1;while(leftright){// 交换左右字符chartempreversed2[left];reversed2[left]reversed2[right];reversed2[right]temp;left;right--;}cout反转字符串(方法2): reversed2endl;return0;}5.3 回文判断#includeiostream#includestring#includecctype// 用于tolower函数usingnamespacestd;intmain(){string str;cout请输入一个字符串: ;getline(cin,str);// 预处理转换为小写移除非字母数字字符string processed;for(charch:str){if(isalnum(ch)){// 如果是字母或数字processedtolower(ch);}}// 判断是否是回文boolisPalindrometrue;intleft0,rightprocessed.length()-1;while(leftright){if(processed[left]!processed[right]){isPalindromefalse;break;}left;right--;}cout\str\ ;if(isPalindrome){cout是回文endl;}else{cout不是回文。endl;}return0;}5.4 简单加密解密#includeiostream#includestringusingnamespacestd;intmain(){string text;intkey;cout请输入要加密的文本: ;getline(cin,text);cout请输入加密密钥(1-25): ;cinkey;// 加密string encryptedtext;for(inti0;iencrypted.length();i){charchencrypted[i];if(isalpha(ch)){charbaseislower(ch)?a:A;encrypted[i](ch-basekey)%26base;}}cout加密结果: encryptedendl;// 解密string decryptedencrypted;for(inti0;idecrypted.length();i){charchdecrypted[i];if(isalpha(ch)){charbaseislower(ch)?a:A;decrypted[i](ch-base-key26)%26base;}}cout解密结果: decryptedendl;return0;}第六部分综合应用项目60分钟6.1 学生成绩管理系统#includeiostream#includestring#includeiomanipusingnamespacestd;constintMAX_STUDENTS50;intmain(){string names[MAX_STUDENTS];intscores[MAX_STUDENTS];intstudentCount0;intchoice;do{// 显示菜单cout\n 学生成绩管理系统 endl;cout1. 添加学生成绩endl;cout2. 显示所有成绩endl;cout3. 查找学生成绩endl;cout4. 统计成绩分析endl;cout5. 成绩排序endl;cout0. 退出系统endl;cout请选择操作: ;cinchoice;switch(choice){case1:{// 添加学生成绩if(studentCountMAX_STUDENTS){cout学生数量已满endl;break;}cout请输入学生姓名: ;cinnames[studentCount];cout请输入names[studentCount]的成绩: ;cinscores[studentCount];studentCount;cout添加成功endl;break;}case2:{// 显示所有成绩if(studentCount0){cout还没有学生数据endl;break;}cout\n 所有学生成绩 endl;coutleftsetw(15)姓名setw(10)成绩等级endl;coutstring(35,-)endl;for(inti0;istudentCount;i){string grade;if(scores[i]90)grade优秀;elseif(scores[i]80)grade良好;elseif(scores[i]70)grade中等;elseif(scores[i]60)grade及格;elsegrade不及格;coutleftsetw(15)names[i]setw(10)scores[i]gradeendl;}break;}case3:{// 查找学生成绩if(studentCount0){cout还没有学生数据endl;break;}string searchName;cout请输入要查找的学生姓名: ;cinsearchName;boolfoundfalse;for(inti0;istudentCount;i){if(names[i]searchName){cout找到学生: names[i]endl;cout成绩: scores[i]endl;foundtrue;break;}}if(!found){cout没有找到学生: searchNameendl;}break;}case4:{// 统计成绩分析if(studentCount0){cout还没有学生数据endl;break;}intsum0,maxScorescores[0],minScorescores[0];intexcellent0,good0,medium0,pass0,fail0;for(inti0;istudentCount;i){sumscores[i];if(scores[i]maxScore)maxScorescores[i];if(scores[i]minScore)minScorescores[i];if(scores[i]90)excellent;elseif(scores[i]80)good;elseif(scores[i]70)medium;elseif(scores[i]60)pass;elsefail;}doubleaveragestatic_castdouble(sum)/studentCount;cout\n 成绩统计分析 endl;cout学生总数: studentCountendl;cout平均分: fixedsetprecision(2)averageendl;cout最高分: maxScoreendl;cout最低分: minScoreendl;cout优秀(90-100): excellent人 ((excellent*100.0/studentCount)%)endl;cout良好(80-89): good人 ((good*100.0/studentCount)%)endl;cout中等(70-79): medium人 ((medium*100.0/studentCount)%)endl;cout及格(60-69): pass人 ((pass*100.0/studentCount)%)endl;cout不及格(0-59): fail人 ((fail*100.0/studentCount)%)endl;break;}case5:{// 成绩排序按成绩降序if(studentCount0){cout还没有学生数据endl;break;}// 使用选择排序按成绩降序排列for(inti0;istudentCount-1;i){intmaxIndexi;for(intji1;jstudentCount;j){if(scores[j]scores[maxIndex]){maxIndexj;}}// 交换成绩inttempScorescores[i];scores[i]scores[maxIndex];scores[maxIndex]tempScore;// 交换姓名string tempNamenames[i];names[i]names[maxIndex];names[maxIndex]tempName;}cout成绩排序完成endl;break;}case0:cout感谢使用学生成绩管理系统endl;break;default:cout无效选择请重新输入endl;}}while(choice!0);return0;}练习与作业基础练习必做练习1数组基础操作创建一个包含10个整数的数组完成以下操作从键盘输入10个数字计算数组元素的总和和平均值找出最大值和最小值及其位置将数组元素逆序存放练习2字符串处理编写程序处理字符串输入一个字符串统计其中元音字母的个数将字符串中的所有空格替换为下划线判断字符串是否包含数字将字符串中的大写字母转换为小写练习3成绩分析使用数组存储一个班级的成绩最多50人输入成绩输入-1结束计算平均分、最高分、最低分统计各分数段人数按成绩从高到低排序挑战练习选做挑战1矩阵运算实现3×3矩阵的基本运算矩阵加法矩阵乘法矩阵转置求矩阵对角线元素和挑战2字符串压缩实现简单的字符串压缩算法将连续重复的字符压缩为字符次数例如“aaabbc压缩为a3b2c1”实现解压缩功能挑战3简单投票系统模拟选举投票系统存储候选人姓名和得票数实现投票功能统计投票结果找出获胜者实验任务任务1数组边界测试测试数组越界访问的后果intarr[5]{1,2,3,4,5};// 尝试访问arr[5], arr[6], arr[-1]等// 观察程序行为并记录结果任务2字符串内存测试测试不同字符串初始化方式的内存使用charstr1[]Hello;charstr2[10]Hello;string str3Hello;// 使用sizeof测试各字符串的大小任务3排序算法比较实现冒泡排序和选择排序比较代码复杂度执行效率交换次数学习总结今天学到了✅数组概念相同类型元素的集合✅数组操作定义、初始化、访问、遍历✅数组应用求最值、求和、计数、排序✅字符串基础字符数组和string类✅字符串操作长度、连接、比较、查找✅批量处理使用循环处理数组和字符串关键技能数组设计合理选择数组大小和数据类型循环遍历使用循环处理数组元素算法思维实现排序、搜索等基本算法字符串处理文本数据的各种操作下一课预告下一节课我们将学习函数与递归初步包括函数的定义、调用、参数传递让代码更加模块化和可复用
版权声明:本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若内容造成侵权/违法违规/事实不符,请联系邮箱:809451989@qq.com进行投诉反馈,一经查实,立即删除!

做网站哪个最好wordpress破解教程

NVIDIA Profile Inspector终极性能调优完整指南:4步解决显卡性能瓶颈 【免费下载链接】nvidiaProfileInspector 项目地址: https://gitcode.com/gh_mirrors/nv/nvidiaProfileInspector 还在为游戏卡顿、画面撕裂而烦恼吗?NVIDIA Profile Inspect…

张小明 2026/1/1 6:51:46 网站建设

福建省住房和城乡建设厅网站首页深圳建设交易工程信息网

FaceFusion能否用于舞蹈教学?导师形象同步示范在一场线上舞蹈课中,学员盯着屏幕努力模仿导师的动作,却总觉得“隔着一层”——动作对了,感觉不对。那个跳舞的人不是自己,仿佛永远在追逐一个无法代入的影像。如果此刻画…

张小明 2025/12/31 21:58:44 网站建设

学校招办网站怎么做重庆建筑信息网查询

Linux 命令行操作与实践指南 1. tar 命令的使用 1.1 创建归档文件 使用 tar 命令可以在命令行创建和提取归档文件(tarballs)。创建归档文件时,只需输入 tar –cvf ,后面依次跟上最终 tarball 的名称以及要归档的文件夹或文件的名称。例如,要创建一个名为 pics4pal…

张小明 2025/12/30 22:13:59 网站建设

如何做企业网站优化网站买源代码

快速构建自定义仪表盘:Halo组件开发全攻略与创意实践 【免费下载链接】halo 强大易用的开源建站工具。 项目地址: https://gitcode.com/GitHub_Trending/ha/halo 想要为你的Halo站点打造独一无二的仪表盘体验吗?这个强大的开源建站工具提供了完整…

张小明 2025/12/31 11:12:26 网站建设

2008 做网站南皮县网站建设

Linux网络工具配置与网络连接搭建指南 1. trn配置 trn是旧版新闻阅读器rn的继任者,名字中的“t”代表“threaded”(线程化),由Wayne Davidson编写。与tin不同,trn不能在运行时生成线程数据库,而是使用由mthreads程序准备的数据库,该程序需要定期通过cron调用以更新索引…

张小明 2026/1/8 15:40:29 网站建设