MySQL 8.0 OCP 英文题库解析(二十二)

Oracle 为庆祝 MySQL 30 周年,截止到 2025.07.31 之前。所有人均可以免费考取原价245美元的MySQL OCP 认证。

从今天开始,将英文题库免费公布出来,并进行解析,帮助大家在一个月之内轻松通过OCP认证。

微信图片_20250507171214.png

本期公布试题201~210

试题201:

Choose the best answer.You are using an existing server with a new configuration. MySQL Server 
fails to start. Examine this snapshot of the error log:190925 12:49:05 InnoDB:Initializing buffer pool, 
size = 3.0G 190925 12:49:05 InnoDB:Completed initialization of buffer poolInnoDB:Error:log 
file ./ib_logfile0 is of different size 0 5242880 bytes InnoDB:than specified in the .cnf file 0 26214400 
bytes!190925 12:49:05 ERROR Plugin 'InnoDB' init function returned error .190925 12:49:05 ERROR 
Plugin 'InnoDB' registration as a STORAGE ENGINE failed. 190925 12:49:05 ERROR Aborting190925 
12:49:05 Note /usr/sbin/mysqld:Shutdown complete Which action would allow the server to start? 
D)First run mysqld --initialize to refresh the size of ib_logfile. [错误] 
B)Create a new ib_logfile0 file of size 26214400. [错误] 
A)Execute mysqladmin flush-logs. [错误] 
C)Remove ib_logfile0 and ib_logfile1 files from the file system. [正确]

解析

用一台现有服务器,但配置了新的参数。MySQL 服务器启动失败。以下是错误日志的片段:190925 12:49:05 InnoDB: Initializing buffer pool, size = 3.0G  
190925 12:49:05 InnoDB: Completed initialization of buffer pool  
InnoDB: Error: log file ./ib_logfile0 is of different size 0 5242880 bytes  
InnoDB: than specified in the .cnf file 0 26214400 bytes!  
190925 12:49:05 ERROR Plugin 'InnoDB' init function returned error.  
190925 12:49:05 ERROR Plugin 'InnoDB' registration as a STORAGE ENGINE failed.  
190925 12:49:05 ERROR Aborting  
190925 12:49:05 Note /usr/sbin/mysqld: Shutdown complete  D) 首先运行 mysqld --initialize 以刷新 ib_logfile 的大小。(错误)B) 创建一个大小为 26214400 字节的新 ib_logfile0 文件。(错误)A) 执行 mysqladmin flush-logs。(错误)C) 从文件系统中删除 ib_logfile0 和 ib_logfile1 文件。(正确)关键错误信息:InnoDB: Error: log file ./ib_logfile0 is of different size 0 5242880 bytes  
InnoDB: than specified in the .cnf file 0 26214400 bytes!  问题原因:ib_logfile0 的实际大小(5242880 字节 = 5MB) 与 配置文件(.cnf)中指定的 innodb_log_file_size(26214400 字节 = 25MB) 不匹配。InnoDB 要求 日志文件大小必须严格匹配配置,否则会拒绝启动。解决方案✅ C) 删除 ib_logfile0 和 ib_logfile1 文件原理:InnoDB 如果发现日志文件不存在,会在启动时 自动创建新的日志文件,并严格按照 innodb_log_file_size 配置的大小生成。删除旧文件后,MySQL 会重新初始化日志文件,避免大小不匹配的问题。
A) mysqladmin flush-logs	flush-logs 用于轮换二进制日志(binlog)和慢查询日志,不适用于 InnoDB 日志文件。
B) 手动创建 25MB 的 ib_logfile0	虽然大小匹配,但 InnoDB 要求日志文件必须成对(ib_logfile0 和 ib_logfile1)且内容符合格式,手动创建可能损坏日志结构。
D) mysqld --initialize	--initialize 用于 初始化新数据目录,会清空现有数据,不适用于已有数据的服务器。

试题202:

Choose the best answer.Which characters are most commonly used in a SQL injection attack? 
D)^ and $ [错误] 
C)null (\\0) and newline (\) [错误] 
B)< and > [错误] 
A)' and \ [正确] 
E) + and - [错误]

解析

SQL 注入(SQL Injection)是一种常见的 Web 安全漏洞,攻击者通过在用户输入中插入恶意 SQL 代码,欺骗数据库执行非预期的操作。最常用的 SQL 注入字符✅ A) ' 和 \单引号 ':用于 闭合 SQL 语句中的字符串,例如:SELECT * FROM users WHERE username = 'admin' AND password = 'xxx';攻击者可注入 ' OR '1'='1 绕过登录验证:SELECT * FROM users WHERE username = 'admin' AND password = '' OR '1'='1';反斜杠 \:用于 转义特殊字符,攻击者可利用它破坏 SQL 语句结构。

试题203:

Choose the best answer.Examine these commands, which execute successfully on the ic1 
host:mysqlsh> dba.createCluster( 'cluster1' , memberWeight:35) mysqlsh> var mycluster = 
dba.getCluster ()mysqlsh> mycluster.addInstance ( 'ic@ic2' , memberWeight:25) mysqlsh> 
mycluster.addInstance( 'ic@ic3' , memberWeight:50)Now examine this configuration setting, which 
is the same on all nodes:group_replication_consistency=BEFORE_ON_PRIMARY_FAILOVERWhich 
statement is true if primary node ic1 fails? 
E)Node ic2 becomes the new primary and is ignored until any backlog of transactions is completed. 
[错误] 
B)Node ic3 becomes the new primary and existing transactions are considered stale and rolled back. 
[错误] 
C)Node ic3 becomes the new primary and is ignored until any backlog of transactions is completed. 
[正确] 
A)Node ic2 becomes the new primary and existing transactions are considered stale and rolled back. 
[错误] 
D)Only two nodes remain so the election process is uncertain and must be done manually. [错误] 

解析

选择最佳答案。
观察以下在 ic1 主机上成功执行的命令:mysqlsh> dba.createCluster('cluster1', {memberWeight: 35});
mysqlsh> var mycluster = dba.getCluster();
mysqlsh> mycluster.addInstance('ic@ic2', {memberWeight: 25});
mysqlsh> mycluster.addInstance('ic@ic3', {memberWeight: 50});现在观察所有节点上相同的配置设置:group_replication_consistency=BEFORE_ON_PRIMARY_FAILOVER如果主节点 ic1 宕机,以下哪项描述是正确的?MySQL InnoDB Cluster:基于 Group Replication 的高可用解决方案。memberWeight:用于选举主节点(Primary)的权重值(权重越高,优先级越高)。ic1 = 35ic2 = 25ic3 = 50group_replication_consistency=BEFORE_ON_PRIMARY_FAILOVER:在主节点故障转移时,新主节点必须等待所有未完成的事务应用完毕才能接受写入。2. 主节点选举规则当主节点(ic1)宕机时,集群会根据 memberWeight 选举新主节点。ic3 的权重最高(50),因此会成为新主节点。3. BEFORE_ON_PRIMARY_FAILOVER 的影响新主节点(ic3)在接管前必须:等待所有未完成的事务(backlog)应用完毕。在此期间,ic3 不会立即接受客户端写入(即“被忽略”)。不会回滚事务,只是等待同步完成。E)	ic2 成为主节点,并在积压期间被忽略	❌ 错误	ic3 权重更高,应成为主节点。
B)	ic3 成为主节点,事务回滚	❌ 错误	BEFORE_ON_PRIMARY_FAILOVER 不会回滚事务,而是等待同步。
C)	ic3 成为主节点,并在积压期间被忽略	✅ 正确	符合 BEFORE_ON_PRIMARY_FAILOVER 的行为。
A)	ic2 成为主节点,事务回滚	❌ 错误	ic2 不是权重最高的节点。
D)	选举不确定,需手动干预	❌ 错误	权重机制确保自动选举。

试题204:

Choose the best answer. You execute this command:shell> mysqlpump --exclude-databases=% -
users Which statement is true? 
A)It creates a logical backup of all metadata, but contains no table data. [错误] 
D)It creates a logical backup of all MySQL user accounts. [正确] 
C)It creates a logical backup of only the users database. [错误] 
B)It returns an error because the mysqldump command should have been used. [错误] 

解析

shell> mysqlpump --exclude-databases=% --users以下哪项描述是正确的?mysqlpump:MySQL 官方提供的逻辑备份工具(类似 mysqldump,但支持并行备份)。--exclude-databases=%:% 是通配符,表示 排除所有数据库(不备份任何数据库)。--users:仅备份 MySQL 用户账户信息(包括用户名、主机、权限等)。执行该命令后:不会备份任何数据库或表数据(因 --exclude-databases=% 排除了所有库)。仅备份用户账户信息(--users 选项生效),包括:mysql.user、mysql.db、mysql.tables_priv 等权限表的数据。A)	备份所有元数据,不含表数据 ❌ 错误	
--exclude-databases=% 排除了所有数据库元数据,仅备份用户信息。D)	备份所有 MySQL 用户账户	✅ 正确	
--users 明确指定备份用户信息。C)	仅备份 users 数据库	❌ 错误	
users 是选项名,非数据库名,且所有数据库已被排除。B)	应使用 mysqldump 导致错误	❌ 错误	
mysqlpump 是合法命令,语法无误。

试题205:

Choose the best answer You want to log only the changes made to the database objects and data 
on the MySQL system. Which log will do this by default? 
C)error log [错误] 
D)general query log [错误] 
E)audit log [错误] 
A)slow query log [错误] 
B)binary log [正确]

解析


B)binary log [正确]二进制日志(Binary Log)功能:记录所有对数据库的修改操作(如INSERT、UPDATE、DELETE、DDL语句),用于主从复制和数据恢复。符合题意:题目描述的“记录更改”正是二进制日志的核心功能。

试题206:

Choose the best answer.Examine this partial output for InnoDB Cluster status:(见下图)Which 
statement explains the state of the instance deployed on host2?C)It can be recovered from a donor instance on host3 by cloning using the command 
cluster.rejoinInstance ('<user>@host3:3377'). [正确] 
B)It has been expelled from the cluster because of a transaction error. [错误] 
D)It has been removed from the cluster by using the command STOP GROUP_REPLICATION;. . [错误] 
E)It can rejoin the cluster by using the command dba. rebootClusterFromCompleteOutage(). [错误] 
A)It can rejoin the cluster by using the command cluster.addInstance ('<user>@host3:3377'). [错误]

图片.png

解析

    InnoDB Cluster 状态分析(图片内容):host1:3377:模式为 R/W(读写),状态 ONLINE(在线)。host2:3377:模式为 R/O(只读),状态 (MISSING)(缺失)。host3:3377:模式为 R/O(只读),状态 ONLINE(在线)。(MISSING) 状态的含义:表示该实例当前未连接到集群,但未被永久移除(可能因网络问题、崩溃或主动退出导致)。需要重新加入(rejoin)或从其他节点恢复。选项分析:✅ C) 可以通过克隆方式从 host3 的捐赠实例恢复,使用 cluster.rejoinInstance()。正确:host2 状态为 (MISSING),但仍属于集群配置的一部分。rejoinInstance() 是专门用于让缺失实例重新加入集群的命令。若数据不一致,可通过克隆(clone)从在线节点(如 host3)同步数据。❌ A) 使用 cluster.addInstance() 重新加入。错误:addInstance() 用于添加全新实例,而 host2 是已存在的实例,应使用 rejoinInstance()。❌ B) 因事务错误被驱逐。错误:(MISSING) 仅表示实例离线,未被明确驱逐(驱逐会显示 EXPELED)。❌ D) 因执行 STOP GROUP_REPLICATION 被移除。错误:手动停止组复制不会导致状态变为 (MISSING),而是显示为 OFFLINE。❌ E) 使用 dba.rebootClusterFromCompleteOutage() 恢复。错误:该命令用于整个集群崩溃后重启,不适用于单个实例恢复。

试题207:

Choose the best answer.You use Row Based Replication and need to see \pseudo-SQL\ statements 
for the replication event that is located in the log_file position NNNNN file.Which command should 
you use? 
H)mysqlshow --verbose --start-position=NNNNN log_file [错误] 
F)mysqlbinlog --verbose - - stop-position=NNNNN log_file [错误] 
E)mysqlshow --verbose --stop-position=NNNNN log_file [错误] 
C)mysqlbinlog --debug --start-position=NNNNN log_file [错误] 
B)mysqlbinlog --verbose --start-position=NNNN log_file [正确] 
D)mysqlbinlog --debug -- stop-position=NNNNN log_file [错误] 
G)mysqlshow --debug --start-position=NNNNN log_file [错误] 
A)mysqlshow --debug --stop-position=NNNNN log_file [错误] 

解析

--verbose(-v)选项:将行格式的binlog转换为伪SQL语句(--verbose 或 -v 会显示更详细的信息)。
--start-position=NNNNN:指定从哪个日志位置开始解析(题目要求查看“位于NNNNN的事件”)。

试题208:

Choose the best answer.Which utility would you use to view the queries in the slow query log 
sorted by average query time? 
B)mysqlshow [错误] 
C)mysqlimport [错误] 
A)mysqlcheck [错误] 
E)mysqldumpslow [正确] 
D)mysqldump [错误]

解析

mysqldumpslow 是专门用于分析慢查询日志的工具

试题209:

Choose the best answer.Examine the command, which executes successfully:shell> mysqld -
initialize Which statement is true? 
D)The root password is not created allowing easy access from the same host. [错误] 
B)The installation creates a temporary test environment with data in the /tmp directory. [错误] 
A)The root password is created in the error log in plain text. [正确] 
C)The installation is created without enforcing or generating SSL certificates. [错误]

解析

题目:
分析以下命令(该命令执行成功):
shellshell> mysqld --initialize哪一项描述是正确的?选项:
A) root 密码以明文形式生成在错误日志中。 [正确]
B) 安装过程会在 /tmp 目录下创建一个临时的测试环境及数据。 [错误]
C) 安装过程中不会强制执行或生成 SSL 证书。 [错误]
D) root 密码不会被创建,从而允许同一主机轻松访问。 [错误]
中文解析:
关键点:mysqld --initialize 的作用mysqld --initialize(MySQL 5.7+ 的初始化方式):用于初始化一个新的 MySQL 数据目录(如首次安装 MySQL)。不会自动启动 MySQL 服务,仅生成系统表(如 mysql.user)和初始结构。默认情况下,会生成一个随机的 root 密码,并记录在错误日志(error log)中(明文显示)。mysqld --initialize-insecure(不安全模式):如果使用 --initialize-insecure,则 root 密码为空(符合选项 D 的描述)。但题目使用的是 --initialize,所以 D 是错误的。选项分析:✅ A) root 密码以明文形式生成在错误日志中。正确。--initialize 会生成随机密码,并写入错误日志(如 /var/log/mysql/error.log)。❌ B) 安装过程会在 /tmp 目录下创建临时测试环境。错误。--initialize 初始化的是正式的数据目录(如 /var/lib/mysql),而非 /tmp。❌ C) 安装过程中不会强制执行或生成 SSL 证书。错误。SSL 证书是否生成取决于配置(如 auto_generate_certs 参数),但 --initialize 本身不涉及 SSL 管理。❌ D) root 密码不会被创建,允许同一主机轻松访问。错误。--initialize 会生成密码,只有 --initialize-insecure 才会留空密码。

试题210:

Choose the best answer.Your MySQL environment has asynchronous position based-replication 
with one master and one slave.The slave instance had a disk I/O problem, so it was stopped.You 
determined that the slave relay log files were corrupted and unusable, but no other files are 
damaged.You restart MySQL Server.How can replication be restored? 
A)The slave relay logs should be deleted; then execute START SLAVE; [错误] 
B)The slave needs to be restored from backup. [错误] 
C)The slave relay logs should be deleted; execute CHANGE MASTER to adjust the replication relay 
log file name, then issue START SLAVE; [正确] 
D)The relay logs from the master should be used to replace the corrupted relay logs. [错误]

解析

MySQL 环境采用基于位置的异步复制(asynchronous position-based replication),包含一个主库(master)和一个从库(slave)。
从库因磁盘 I/O 问题被停止运行。你发现从库的中继日志(relay log)已损坏且不可用,但其他文件未损坏。
现在重启 MySQL 服务,如何恢复复制?A) 删除从库的中继日志,然后执行 START SLAVE; [错误]
B) 需要从备份恢复从库 [错误]
C) 删除从库的中继日志,执行 CHANGE MASTER 调整复制中继日志文件名,再执行 START SLAVE; [正确]
D) 使用主库的中继日志替换损坏的从库中继日志 [错误]从库的中继日志(relay log)损坏,但其他文件(如 relay-log.info、master.info)未损坏。
由于复制是基于位置的,只要知道主库的 binlog 位置,就可以重新同步。步骤:删除损坏的中继日志(如 rm /var/lib/mysql/relay-log.*)。执行 CHANGE MASTER,重新指定主库的 binlog 位置(从 relay-log.info 获取):sqlCHANGE MASTER TO MASTER_LOG_FILE='master-bin.XXXXXX', MASTER_LOG_POS=XXXXXX;启动复制:START SLAVE;

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

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

相关文章

【大模型推理】PD分离场景下decoder负载均衡,如何选取decoder

https://mp.weixin.qq.com/s?__bizMzg4NTczNzg2OA&mid2247507420&idx1&sn4b32726abd205c7f94144bcb9105330f&chksmce64b9fc7f1d8de04a40b0153302dee52262c6f104c67195e2586e75c8093b8be493f252c8a3#rd 在非 Local 场景下&#xff0c;Prefill 定时获取 Decode …

【IP地址】IP应用场景的使用方向

网络安全领域 通过IP地址查询&#xff0c;安全系统能够实时监控网络流量&#xff0c;识别异常访问行为。例如&#xff0c;当某个IP地址在短时间内频繁发起大量请求&#xff0c;且访问模式与正常用户存在明显差异时&#xff0c;系统可将其标记为可疑IP&#xff0c;触发风险预警…

3-18 WPS JS宏 颜色设置实例应用(按条件设置单元格颜色)学习笔记

前面讲解了关于单元格的一些格式的设置&#xff0c;本节课再讲解一下各种清除方法。 1.函数解析与用法 Range().clear()//清除全部 Range().Value2null //清除内容 Range().ClearContents()//清除内容 Range().ClearFormats()//清除格式 Range().EntireRow.Range()//以Ra…

从零开始的云计算生活——第二十天,脚踏实地,SSH与Rsync服务

目录 一.故事背景 二.SSH带外管理 1.概述 2. 配置文件 3.命令解析 4.登录方式配置 a.用户名密码登录 b.公钥验证登录 5.实操生成密钥对 三.Rsyncsersync实现数据实时同步 1.rsync概述 2.rsync运行原理 3.rsync部署 4.备份测试 配置备份目录 5.rsyncsersync 实现…

SpringAI + DeepSeek大模型应用开发 - 初识篇

一、认识AI 1. AI的发展 AI&#xff0c;人工智能&#xff08;Artificial Intelligence&#xff09;&#xff0c;使机器能像人类一样思考、学习和解决问题的技术。 2. 大模型及其原理 在自然语言处理&#xff08;Natural Language Processing, NLP&#xff09;中&#xff0c;…

c++第八天-多态

虚函数虚析构函数纯虚函数与抽象类 多态实现的条件&#xff1a;&#xff08;1&#xff09;公有继承 &#xff08;2&#xff09;派生类重写基类虚函数 &#xff08;3&#xff09;基类指针/引用指向派生类对象 虚函数不能是构造函数&#xff0c;不能是静态函数&#xff0c;不能…

全景图渲染Vue3+TS使用Photo Sphere Viewer插件实现

1.Photo Sphere Viewer插件安装: title=插件安装 体验AI代码助手 代码解读复制代码npm install photo-sphere-viewer -S 或 yarn add photo-sphere-viewer -S 2.原始全景图展示 初始化标签容器 体验AI代码助手 代码解读复制代码 // 全景图的根节点必须要具备宽高 TS引用,创建…

Redis之分布式锁(3)

这篇文章我们来详细介绍一下如何正确地基于Redis实现分布式锁。 基于Redis的分布式锁实现 组件依赖 首先通过Maven引入Jedis开源组件&#xff0c;在pom.xml文件加入下面的代码&#xff1a; <dependency><groupId>redis.clients</groupId><artifactId&g…

Java课堂笔记11

三个修饰符 一、abstract&#xff08;抽象&#xff09; 1.抽象方法只能在抽象的类里&#xff0c;只有方法的声明&#xff0c;没有方法的实现。&#xff08;没有{}直接&#xff1b;结尾&#xff09;。 2.abstract修饰的类称为抽象类。 注意&#xff1a;&#xff08;1&#x…

Linux 核心知识点整理(高频考点版)

一、编译与工具链 GCC 编译流程 四阶段&#xff1a;预处理&#xff08;-E&#xff0c;处理头文件 / 宏&#xff09;→ 编译&#xff08;-S&#xff0c;生成汇编&#xff09;→ 汇编&#xff08;-c&#xff0c;生成目标文件&#xff09;→ 链接&#xff08;生成可执行程序&…

轻量化社交管理方案:Skout与云手机的巧妙搭配

在移动社交时代&#xff0c;许多用户开始尝试通过多账号管理来拓展社交圈层。近期测试了Skout社交平台与亚矩阵云手机的搭配使用&#xff0c;发现这个组合为轻量级社交账号管理提供了一个值得关注的解决方案。 基础功能介绍 这套组合的核心优势在于&#xff1a; 通过云手机实…

ETL连接器好用吗?如何实现ETL连接?

目录 一、ETL连接器的功能和优势 1. 数据抽取能力 2. 数据转换功能 3. 数据加载功能 4. 优势总结 二、实现ETL连接的步骤 1. 需求分析 2. 选择合适的ETL连接器 3. 配置数据源和目标系统 4. 设计ETL流程 5. 开发和测试ETL任务 6. 部署和监控ETL任务 三、ETL连接器在…

uniapp实现聊天中的接发消息自动滚动、消息定位和回到底部

前言 前言无需多言&#xff0c;想必大家对聊天软件的功能已经很熟悉&#xff0c; 这里不做过多赘述&#xff0c;笔者通过uniapp实现聊天中的接发消息自动滚动、消息定位和回到底部。 代码实现 <template><view class"chat-container"><!-- 消息列表…

MyBatisMyBatis plus

整合 MyBatis 到 Spring 或 Spring Boot 项目中&#xff0c;可以极大地简化开发流程&#xff0c;尤其是当使用 Spring Boot 时&#xff0c;它提供了自动配置功能&#xff0c;使得集成更加简便。 在 Spring Boot 中整合 MyBatis 1. 添加依赖 首先&#xff0c;在 pom.xml 文件中…

Stable Diffusion 实战-手机壁纸制作 第二篇:优化那些“崩脸”和“马赛克”问题,让图像更加完美!

欢迎回来!在《StableDiffusion实战-手机壁纸制作》系列的第一篇中,我们成功完成了基础操作,制作出了令人炫目的手机壁纸。 今天,我们将进入一个更高阶的领域——优化处理。因为谁不想让生成的艺术品更完美呢?尤其是避免“崩脸”和“马赛克”这种让人抓狂的问题! 创作的路…

408第一季 - 数据结构 - B树与B+树

B树 性质 可以看见一个节点可以有多个数字了 然后也满足左小右大的特征 然后所有的叶子节点都在同一层&#xff0c;然后2个数字的节点就可以有3个分支 然后呢&#xff0c;每个节点里面到底有几个数字是有规定的公式的 就这个公式&#xff0c;m是5阶的&#xff0c;算出来是2和…

SSRF5 Gopher 协议对内网 Web 服务进行 sql 注入 GET 类型和POST类型

实验环境&#xff1b; Centos7.6上同时安装sqli-lib和pikachu 一.Gopher 协议对内网 Web 服务进行 sql 注入 GET 类型 我们先访问sqli-lib第1关 然后我们构造URL&#xff1a; http://192.168.112.12/pikachu-master/vul/ssrf/ssrf_curl.php?urlhttp://192.168.112.12/sql…

Python打卡DAY31

DAY31&#xff1a;文件的规范拆分和写法 恩师浙大疏锦行 知识点&#xff1a; 规范的文件命名规范的文件夹管理机器学习项目的拆分编码格式和类型注解 一、机器学习项目流程&#xff1a; 1、数据加载&#xff1a;从文件、数据库、API 等获取原始数据。 - 命名参考&#xff1a;…

字符串大数 -减法

描述 以字符串的形式读入两个数字&#xff0c;编写一个函数计算它们的和&#xff0c;以字符串形式返回。 代码实现 大小判断&#xff1a;a - b 与 b - a 的绝对值相等将大的数放前面&#xff0c;抽离出结果的符号 import random s, t str(random.randint(1000, 9999)), s…

android google tts如何不联网内部预置多国语音包

在内置Google GMS服务的设备中&#xff0c;可以正常使用TTS&#xff0c;并且可以联网下载多国的语音包。然而&#xff0c;对于未通过GMS认证&#xff0c;只能使用基础的TTS英语播报&#xff0c;而且联网后是无法下载语音包的&#xff0c;会提示需要google service。本文基于以上…