拼图小游戏(实现游戏主界面)(未连接数据库)

 注释:

基于IDEA,创建窗体进行游戏

默认的用户名和密码为:zhangsan,123

                                        lisi,1234

App界面

package marchwho.ui;public class App {public static void main(String[] args) {//登录的窗体new LogInJFrame();//注册的窗体//  new RegisterJFrame();//游戏主界面的窗体//  new GameJFrame();}
}

游戏主界面

package marchwho.ui;import javax.swing.*;
import javax.swing.border.BevelBorder;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.KeyEvent;
import java.awt.event.KeyListener;
import java.util.Random;public class GameJFrame extends JFrame implements KeyListener, ActionListener {//游戏主界面//创建胜利的二位数组int[][] win = new int[][]{{1, 2, 3, 4},{5, 6, 7, 8},{9, 10, 11, 12},{13, 14, 15, 0}};//创建一个二维数组//用于打乱图片int[][] data = new int[4][4];//用于空白图片的移动int x = 0;int y = 0;//加载图片的路径String path = "../puzzleagame/image/girl/girl1/";//统计步数int step = 0;//创建选项下面的条目JMenuItem replayItem = new JMenuItem("重新游戏");JMenuItem reLoginItem = new JMenuItem("重新登录");JMenuItem closeItem = new JMenuItem("关闭游戏");JMenuItem codeItem = new JMenuItem("作者");//创建更换图片下的条目JMenuItem GirlItem = new JMenuItem("美女");JMenuItem AnimalItem = new JMenuItem("动物");JMenuItem SportItem = new JMenuItem("运动");//创建帮助下面的条目JMenuItem AItem = new JMenuItem("按A查看完整图片");public GameJFrame() {//初始化界面initJFrame();//初始化菜单initJMenuBar();//打乱图片initData();//初始化图片initImage();//让界面可以显示出来this.setVisible(true);}private void initData() {int[] arr = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 0};Random r = new Random();//将一维数组打乱for (int i = 0; i < arr.length; i++) {int index = r.nextInt(arr.length);int temp = arr[i];arr[i] = arr[index];arr[index] = temp;}//将打乱的一维数组依次放入二维数组中for (int i = 0; i < arr.length; i++) {//获得空白图片所对应的位置if (arr[i] == 0) {x = i / 4;y = i % 4;}data[i / 4][i % 4] = arr[i];}}private void initImage() {//清空已经出现的所有图片this.getContentPane().removeAll();//添加胜利的图标if (victory()) {ImageIcon winicon = new ImageIcon("../puzzleagame/image/win.png");JLabel winJLabel = new JLabel(winicon);winJLabel.setBounds(203, 283, 197, 73);this.getContentPane().add(winJLabel);}JLabel Step = new JLabel("步数" + step);Step.setBounds(50, 30, 100, 20);this.getContentPane().add(Step);for (int j = 0; j < 4; j++) {//外循环---将内循环执行四次,即添加四行图片for (int i = 0; i < 4; i++) {//内循环---将一行的图片进行添加//将打乱的二维数组所对应的数字将图片进行打乱int number = data[j][i];//创建一个图片ImageIcon对象ImageIcon icon = new ImageIcon(path + number + ".jpg");//创建一个JLabel对象(管理容器)JLabel jLabel = new JLabel(icon);//指定图片位置jLabel.setBounds(105 * i + 83, 105 * j + 134, 105, 105);//添加图片边框//0---凸出来//1---凹出来jLabel.setBorder(new BevelBorder(BevelBorder.LOWERED));//获取隐藏窗口,通过XY轴设置图片的位置与图片的大小this.getContentPane().add(jLabel);}}//添加背景图片ImageIcon background = new ImageIcon("../puzzleagame/image/background.png");JLabel BackGround = new JLabel(background);BackGround.setBounds(40, 40, 508, 560);this.getContentPane().add(BackGround);//刷新界面this.getContentPane().repaint();}private void initJMenuBar() {//创建菜单对象JMenuBar jMenuBar = new JMenuBar();//创建菜单里面的选项对象(功能 关于我们)JMenu functionJMenu = new JMenu("功能");JMenu aboutJMenu = new JMenu("关于我们");JMenu helpJMenu = new JMenu("帮助");JMenu changeJMenu = new JMenu("更换图片");//将条目添加到选项中functionJMenu.add(changeJMenu);changeJMenu.add(GirlItem);changeJMenu.add(AnimalItem);changeJMenu.add(SportItem);helpJMenu.add(AItem);functionJMenu.add(replayItem);functionJMenu.add(reLoginItem);functionJMenu.add(closeItem);aboutJMenu.add(codeItem);//给条目绑定事件replayItem.addActionListener(this);reLoginItem.addActionListener(this);closeItem.addActionListener(this);codeItem.addActionListener(this);GirlItem.addActionListener(this);AnimalItem.addActionListener(this);SportItem.addActionListener(this);//将选项添加到菜单中jMenuBar.add(functionJMenu);jMenuBar.add(aboutJMenu);jMenuBar.add(helpJMenu);//给整个界面设置菜单this.setJMenuBar(jMenuBar);}private void initJFrame() {//设置界面的宽高this.setSize(603, 680);//设置界面的标题this.setTitle("拼图游戏 V1.0");//设置界面置顶this.setAlwaysOnTop(true);//设置界面居中,处于屏幕中间this.setLocationRelativeTo(null);//设置关闭模式//关闭之后虚拟机也会停止运行this.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);//创建键盘监听this.addKeyListener(this);//取消内部默认居中格式this.setLayout(null);}@Overridepublic void keyTyped(KeyEvent e) {}//按住不松@Overridepublic void keyPressed(KeyEvent e) {int code = e.getKeyCode();if (code == 65) {//将界面中的所有图片删除this.getContentPane().removeAll();//加载完整的图片JLabel all = new JLabel(new ImageIcon(path + "all.jpg"));all.setBounds(83, 134, 420, 420);this.getContentPane().add(all);//添加背景图片ImageIcon background = new ImageIcon("../puzzleagame/image/background.png");JLabel BackGround = new JLabel(background);BackGround.setBounds(40, 40, 508, 560);this.getContentPane().add(BackGround);//刷新界面this.getContentPane().repaint();}}@Overridepublic void keyReleased(KeyEvent e) {//判断如果胜利则将不能移动if (victory()) {return;}//上:38 下:40 左:37 右:39int code = e.getKeyCode();//上移if (code == 38) {if (x == 0) {return;}System.out.println("向左移动");data[x][y] = data[x - 1][y];data[x - 1][y] = 0;x--;initImage();step++;}//下移else if (code == 40) {if (x == 3) {return;}System.out.println("向右移动");data[x][y] = data[x + 1][y];data[x + 1][y] = 0;x++;initImage();step++;}//左移else if (code == 37) {if (y == 0) {return;}System.out.println("向上移动");data[x][y] = data[x][y - 1];data[x][y - 1] = 0;y--;initImage();step++;}//右移else if (code == 39) {if (y == 3) {return;}System.out.println("向下移动");data[x][y] = data[x][y + 1];data[x][y + 1] = 0;y++;initImage();step++;} else if (code == 65) {initImage();} else if (code == 81) {data = new int[][]{{1, 2, 3, 4},{5, 6, 7, 8},{9, 10, 11, 12},{13, 14, 15, 0}};initImage();}}public boolean victory() {for (int i = 0; i < data.length; i++) {for (int j = 0; j < data[i].length; j++) {if (data[i][j] != win[i][j]) {//只要有一个不一样,就返回falsereturn false;}}}return true;}@Overridepublic void actionPerformed(ActionEvent e) {Object source = e.getSource();if (source == replayItem) {System.out.println("重新游戏");//步数清零step = 0;//重新打乱二维数组initData();//重新加载图片initImage();} else if (source == reLoginItem) {System.out.println("重新登录");//关闭游戏界面this.setVisible(false);//返回登录new LogInJFrame();} else if (source == closeItem) {System.out.println("关闭游戏");//关闭虚拟机System.exit(0);} else if (source == codeItem) {System.out.println("作者");//创建弹框对象JDialog jDialog = new JDialog();//创建一个管理容器的对象ImageIcon icon = new ImageIcon();JLabel jLabel = new JLabel(icon);jLabel.setBounds(0, 0, 258, 258);//将图片放到弹框中jDialog.getContentPane().add(jLabel);//设置弹框大小jDialog.setSize(344, 344);//设置弹框置顶jDialog.setAlwaysOnTop(true);//设置弹框居中jDialog.setLocationRelativeTo(null);//弹框不关闭无法再进行操作jDialog.setModal(true);//显示弹框jDialog.setVisible(true);} else if (source == GirlItem) {System.out.println("美女");//获得随机的索引代表不同的美女图片Random r  =new Random();int index = r.nextInt(13);//加载图片的路径path = "../puzzleagame/image/girl/girl"+index+"/";//步数清零step = 0;//打乱图片initImage();}else if (source == AnimalItem) {System.out.println("动物");//获得随机的索引代表不同的动物图片Random r  =new Random();int index = r.nextInt(8);//加载图片的路径path = "../puzzleagame/image/animal/animal"+index+"/";//步数清零step = 0;//打乱图片initImage();}else if (source == SportItem) {System.out.println("运动");//获得随机的索引代表不同的运动图片Random r  =new Random();int index = r.nextInt(10);//加载图片的路径path = "../puzzleagame/image/sport/sport"+index+"/";//步数清零step = 0;//打乱图片initImage();}}
}

登录界面

package marchwho.ui;import javax.swing.*;
import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;
import java.util.ArrayList;public class LogInJFrame extends JFrame implements MouseListener {//登录界面//创建一个集合存储正确的用户名和密码static ArrayList<User> list = new ArrayList<>();static {list.add(new User("zhangsan", "123"));list.add(new User("lisi", "1234"));}//2.添加用户名输入框JTextField username = new JTextField();//4.密码输入框JPasswordField password = new JPasswordField();//验证码的输入框JTextField code = new JTextField();//5.添加登录按钮JButton login = new JButton();//6.添加注册按钮JButton register = new JButton();//生成的验证码JLabel rightCode = new JLabel();public LogInJFrame() {//初始化界面initJFrame();//在这个界面中添加内容initView();//让当前界面显示出来this.setVisible(true);}public void initView() {//1. 添加用户名文字JLabel usernameText = new JLabel(new ImageIcon("D:\\IDEA\\puzzleagame\\image\\login\\用户名.png"));usernameText.setBounds(116, 135, 47, 17);this.getContentPane().add(usernameText);//2.添加用户名输入框username.setBounds(195, 134, 200, 30);this.getContentPane().add(username);//3.添加密码文字JLabel passwordText = new JLabel(new ImageIcon("D:\\IDEA\\puzzleagame\\image\\login\\密码.png"));passwordText.setBounds(130, 195, 32, 16);this.getContentPane().add(passwordText);//4.密码输入框password.setBounds(195, 195, 200, 30);this.getContentPane().add(password);//验证码提示JLabel codeText = new JLabel(new ImageIcon("D:\\IDEA\\puzzleagame\\image\\login\\验证码.png"));codeText.setBounds(133, 256, 50, 30);this.getContentPane().add(codeText);//验证码的输入框code.setBounds(195, 256, 100, 30);this.getContentPane().add(code);String codeStr = CodeUtil.getCode();//设置内容rightCode.setText(codeStr);//位置和宽高rightCode.setBounds(300, 256, 50, 30);//添加到界面this.getContentPane().add(rightCode);//5.添加登录按钮login.setBounds(123, 310, 128, 47);login.setIcon(new ImageIcon("D:\\IDEA\\puzzleagame\\image\\login\\登录按钮.png"));//去除按钮的默认边框login.setBorderPainted(false);//去除按钮的默认背景login.setContentAreaFilled(false);this.getContentPane().add(login);//6.添加注册按钮register.setBounds(256, 310, 128, 47);register.setIcon(new ImageIcon("D:\\IDEA\\puzzleagame\\image\\login\\注册按钮.png"));//去除按钮的默认边框register.setBorderPainted(false);//去除按钮的默认背景register.setContentAreaFilled(false);this.getContentPane().add(register);//7.添加背景图片JLabel background = new JLabel(new ImageIcon("D:\\IDEA\\puzzleagame\\image\\login\\background.png"));background.setBounds(0, 0, 470, 390);this.getContentPane().add(background);//设置注册、登录、验证码的鼠标监听register.addMouseListener(this);login.addMouseListener(this);rightCode.addMouseListener(this);}public void initJFrame() {//设置界面的宽高this.setSize(488, 430);//设置界面的标题this.setTitle("拼图游戏 登录");//设置界面置顶this.setAlwaysOnTop(true);//设置界面居中,处于屏幕中间this.setLocationRelativeTo(null);//设置关闭模式//关闭之后虚拟机也会停止运行this.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);//让界面可以显示出来this.setVisible(true);}//创建弹窗显示//要展示用户名或密码错误public void showJDialog(String content) {//创建一个弹框对象JDialog jDialog = new JDialog();//给弹框设置大小jDialog.setSize(200, 150);//让弹框置顶jDialog.setAlwaysOnTop(true);//让弹框居中jDialog.setLocationRelativeTo(null);//弹框不关闭永远无法操作下面的界面jDialog.setModal(true);//创建Jlabel对象管理文字并添加到弹框当中JLabel warning = new JLabel(content);warning.setBounds(0, 0, 200, 150);jDialog.getContentPane().add(warning);//让弹框展示出来jDialog.setVisible(true);}//点击@Overridepublic void mouseClicked(MouseEvent e) {Object source = e.getSource();if (source == login) {System.out.println("点击登录按钮");//先获取用户输入的用户名、密码、验证码String usernameText = username.getText();String passwordText = password.getText();String codeText = code.getText();//先判断输入是否为空if (usernameText.length() == 0 || passwordText.length() == 0) {showJDialog("用户名或密码不能为空");} else if (codeText.length() == 0) {showJDialog("验证码不能为空");}//不为空,开始判断else {if (compare(list, usernameText, passwordText)) {if (codeText.equals(rightCode.getText())) {showJDialog("登录成功");//关闭登录界面this.setVisible(false);//打开游戏主界面new GameJFrame();} else {showJDialog("验证码输入错误");}} else {showJDialog("用户名或密码输入错误");}}} else if (source == register) {System.out.println("点击注册按钮");} else if (source == rightCode) {System.out.println("点击验证码,重新获取验证码");String codeStr = CodeUtil.getCode();rightCode.setText(codeStr);}}//判断用户名是否存在public static boolean compare(ArrayList<User> list, String usernameText, String passwordText) {for (int i = 0; i < list.size(); i++) {User user = list.get(i);if (user.getusername().equals(usernameText) && user.getpassword().equals(passwordText)) {return true;}}return false;}//按下不松@Overridepublic void mousePressed(MouseEvent e) {Object source = e.getSource();if (source == register) {//设置点击注册之后的颜色加深//相当于换一个图片register.setIcon(new ImageIcon("D:\\IDEA\\puzzleagame\\image\\login\\注册按下.png"));} else if (source == login) {//设置点击登录之后的颜色加深//相当于换一个图片login.setIcon(new ImageIcon("D:\\IDEA\\puzzleagame\\image\\login\\登录按下.png"));}}//松开@Overridepublic void mouseReleased(MouseEvent e) {Object source = e.getSource();if (source == register) {//变回原来的图片register.setIcon(new ImageIcon("D:\\IDEA\\puzzleagame\\image\\login\\注册按钮.png"));} else if (source == login) {//变回原来的图片login.setIcon(new ImageIcon("D:\\IDEA\\puzzleagame\\image\\login\\登录按钮.png"));}}@Overridepublic void mouseEntered(MouseEvent e) {}@Overridepublic void mouseExited(MouseEvent e) {}}

登录界面所需要的User类

package marchwho.ui;public class User {private String username;private String password;public User() {}public User(String username, String password) {this.username = username;this.password = password;}public String getusername() {return username;}public void setusername(String username) {this.username = username;}public String getpassword() {return password;}public void setpassword(String password) {this.password = password;}
}

 生成验证码的工具类

package marchwho.ui;import java.util.Random;public class CodeUtil {//工具类//生成验证码public CodeUtil() {}//生成一个随机的验证码//四个字母+一个数字//数字位置随机//将生成的字符数组内容放到一个字符串里面public static String getCode() {String result = changeLetter();return result;}public static String changeLetter() {char[] code = getArr();String getcode = "";for (int i = 0; i < code.length; i++) {getcode = getcode + code[i];}return getcode;}public static char[] getArr() {//创建一个字符串数组,长度为5char[] arr = new char[5];Random r = new Random();//获得随机的一个数字int number = r.nextInt(9);//获得随机的一个字母数组char[] letter = getLetter();String result = "";//先将数字放在最后一位for (int i = 0; i < arr.length - 1; i++) {int letterNumber = r.nextInt(52);result = result + letter[letterNumber];}result = result + number;//将数字索引进行打乱int numberIndex = r.nextInt(arr.length - 1);//将结果变成一个字符串数组for (int i = 0; i < result.length(); i++) {char c = result.charAt(i);arr[i] = c;}//将最后一个索引的内容与前面交换char temp = arr[arr.length - 1];arr[arr.length - 1] = arr[numberIndex];arr[numberIndex] = temp;return arr;}//获得随机的一个字母数组public static char[] getLetter() {char[] arr = new char[52];for (int i = 0; i < arr.length; i++) {if (i <= 25) {arr[i] = (char) (97 + i);} else {arr[i] = (char) (65 + i - 26);}}return arr;}
}

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/625759.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

操作系统复习 九-十二 章

操作系统复习 九-十二 章 文章目录 操作系统复习 九-十二 章第九章 单处理器调度调度的概念调度的时机、切换与过程进程调度方式调度的基本准则进程的挂起态与七状态模型典型的调度算法 第十一章 I/O管理和磁盘调度I/O 设备I/O控制方式I/O子系统的层次结构IO子系统概述IO调度概…

【电子取证篇】蘇小沐的电子取证工具合集在线文档

【电子取证篇】蘇小沐的电子取证工具合集在线文档 弄成了在线表格&#xff0c;记得及时保存&#xff1b;工具永远只是辅助&#xff0c;但不要过多依赖自动化&#xff0c;有难度说明可以提升&#xff0c;既要不断学习也要不停思考&#xff0c;知行合一—【蘇小沐】 【腾讯文档…

Spring Boot中操作数据库的几种并发事务方式

当有多个并发事务时&#xff0c;会发生丢失更新异常。来自一个或多个事务的更新可能会丢失&#xff0c;因为其他事务会用其结果覆盖它。 让我们通过一个例子来检验一下。考虑以下执行事务的方法。 public void withdraw(Long accountId, double amount) { Account account a…

解决防爬虫机制方法(二)

最近为了完成学校的大数据的作业&#xff0c;老师要我们爬一个的网站&#xff0c;里面有还算不错的防爬机制&#xff0c;忙活了几天&#xff0c;总结出一些常见的防爬机制的应对方法&#xff0c;方法均来自个人实战总结&#xff0c;非专业爬虫角度分析 承接上一次讲的方法解决…

OpenAI 悄然更新使用政策

据 The Intercept 报道&#xff0c;OpenAI 近日悄然在其使用政策中删除了「明确禁止将其技术用于军事目的」的措辞。 截至 1 月 10 日&#xff0c;OpenAI 的「使用政策」页面还包括禁止「具有高人身伤害风险的活动」&#xff0c;特别是应用于「武器开发」和「军事和战争」。 而…

MedSegDiff: Medical Image Segmentation with Diffusion Probabilistic Model

摘要 Diffusion probabilistic model (DPM) recently becomes one of the hottest topic in computer vision. Its image generation application such as Imagen, Latent Diffusion Models and Stable Diffusion have shown impressive generation capabilities, which arouse…

Binder 机制 javanative

一&#xff1a;Binder介绍 Binder是一套ipc通信方案 Binder框架定义了四个角色&#xff1a; Server &#xff0c;Client&#xff0c;ServiceManager &#xff08;以后简称SMgr&#xff09;以及Binder驱动。其中Server &#xff0c;Client&#xff0c;SMgr运行于用户空间&#…

你知道什么是Java中的类型强转吗?

强制类型转换 强转存在与父转子的时候&#xff0c;子转父不需要进行强转&#xff0c;如 Object o "hello"; //String类是Object类的子类&#xff0c;无需进行强转类型强转分为两种情况&#xff1a; Ⅰ、向下转型&#xff1a;将父类对象引用转换为子类对象引用&am…

随心玩玩(十三)Stable Diffusion初窥门径

写在前面&#xff1a;时代在进步&#xff0c;技术在进步&#xff0c;赶紧跑来玩玩 文章目录 简介配置要求安装部署下载模型启动ui插件安装教程分区提示词插件Adetailer插件提示词的分步采样采样器选择采样器的收敛性UniPC采样器 高分辨率修复 (Hires. fix)图生图ControlNet介绍…

jetson nano VNC远程桌面配置及使用(nomachine)

文章目录 jetson nano VNC远程桌面配置及使用1.Nomachine介绍2.在电脑端安装Nomachine3.在Jetson Nano端安装Nomachine4.电脑端连接及使用步骤5.修改分辨率6.NoMachine常见问题6.1 黑屏6.2 白屏 jetson nano VNC远程桌面配置及使用 本节适用于Jetson Nano没有单独显示器可以给…

正则验证封装

正则表达式常用符号说明: .是除换行以外的所有任意符号 \s空白符号 \S除空白符号以外的任意符号 \w字母、数字、下划线 \W 除字母、数字、下划线以外的其他任意符号 \d 数字(0----9) \D 除数字以外的任意其他符号 ^ 字符串开始 $ 字符串结束 * 匹配0到无数次(匹配的是符号前边的…

2023年跨国企业如何实现跨境数据传输合规化(上)

一、什么是数据跨境传输&#xff1f; 首先了解一个概念&#xff0c;什么是数据跨境传输&#xff1f; 数据跨境传输简单概括就是指信息通过互联网等网络媒介&#xff0c;在跨国企业之间进行传递和交换的过程。 有一则官方网站关于全球化数字化的数据统计&#xff1a;仅2019 年…

MyBatisPlus学习笔记二

接上&#xff1a;MyBatisPlus学习笔记一&#xff1a; MyBatisPlus学习笔记一-CSDN博客 1、条件构造器 MyBatisPlus支持各种复杂的where条件&#xff0c;可以满足日常开发的所有需求。 1.1、集成体系 1.2、实例 查询 lambda查询 更新 1.3、总结 2、自定义sql 我们可以利用MyB…

强化学习AI构建实战 - 基于“黄金点”游戏(二)

服务端接口 为了让大家的AI可以顺利地进行游戏&#xff0c;并验证我们对策略和AI的一些实现&#xff0c;我们需要一些基础设施来帮助我们完成一些工作。这些工作包括游戏回合的控制、参与者之间的数据同步、游戏数据的储存等功能。 为了简化这些基础工作&#xff0c;以便大家…

VM虚拟化——物理机迁移至虚拟化

一、安装迁移工具 VMware vCenter Converter Standalone 【安装向导】 【最终用户专利协议】 【最终用户许可协议】 【安装位置】 【安装类型】默认本地安装 【用户体验设置】 【准备安装】 二、迁移 【转换机器】 【源主机】 填ip、用户名和密码 最好是用administ…

训练营四十八天 | 198.打家劫舍 ● 213.打家劫舍II ● 337.打家劫舍III

198.打家劫舍 不要忘记空数组和数组长度为1的情况单独考虑 和前两个状态有关 代码随想录 class Solution {public int rob(int[] nums) {if(nums null && nums.length 0) return 0;if(nums.length 1) return nums[0];int[] dp new int[nums.length];//int[] dp …

易观察|2024年金融科技新趋势揭秘,大模型发展有望落地

2023年&#xff0c;是金融科技市场持续向好的一年&#xff0c;受政策和市场的双重推动&#xff0c;金融科技企业信心大增&#xff0c;未来发展信心指数平均分提升到82.8&#xff0c;创下近三年来的新高。而随着市场、政策和经济的企稳预期&#xff0c;以及GPT大模型技术的迅猛发…

【打卡】牛客网:BM90 最小覆盖子串

题目&#xff1a; BM65 最长公共子序列(二)&#xff1a; 找二者的相同部分&#xff0c;该部分对于二者可以不连续排列的&#xff08;但是是有序的&#xff09;。 BM66 最长公共子串 找二者的相同部分&#xff0c;该部分对于二者是连续排列的。 本题&#xff1a;BM90 最小覆盖…

什么是DDOS高防ip?DDOS高防ip是怎么防护攻击的

随着互联网的快速发展&#xff0c;网络安全问题日益突出&#xff0c;DDoS攻击和CC攻击等网络威胁对企业和网站的正常运营造成了巨大的威胁。为了解决这些问题&#xff0c;高防IP作为一种网络安全服务应运而生。高防IP通过实时监测和分析流量&#xff0c;识别和拦截恶意流量&…

PattPatel-“Introduction to Computing Systems“(4)期末样卷题目解析:C语言递归

C语言的递归我觉得最主要的还是要把Patt&Patel的部分好好理解下&#xff08;因为有和硬件结合的部分&#xff09;&#xff0c;但因为今天就考试&#xff08;来不及做这样的事情&#xff09;&#xff0c;先把之前模拟卷的题目给尝试弄明白&#xff0c;然后考完试之后继续学习…