正文
增加 3 行删除 3 行
1234567891011121314153 行未改动19202122232425262735 行未改动# P5733 【深基6.例1】自动修正[题目传送门](https://www.luogu.com.cn/problem/P5733)## 前置芝士本题要求我们把一个不包含空格的字符串小写字母转大写。在开始之前,我先介绍一个函数:在 STL 当中,`<algorithm>` 有个函数叫 `transform`,它可以将一个或多个输入范围的元素通过指定的操作转换后,存储到目标范围中,它主要有 $2$ 种重载形式。### 单输入范围这种形式用于对**一个输入范围的元素进行转换**,原型如下:```cpptemplate< class InputIt, class OutputIt, class UnaryOperation >OutputIt transform(InputIt first, // 输入范围的起始迭代器(包含)InputIt end, // 输入范围的结束迭代器(不包含)OutputIt d, // 输出范围的起始迭代器UnaryOperation op // 一元转换函数(接收一个参数,返回转换后的值)3 行未改动### 双输入范围这种形式用于对**两个输入范围的元素进行转换**,原型如下:·```cpptemplate< class InputIt1, class InputIt2, class OutputIt, class BinaryOperation >OutputIt transform(InputIt1 first, // 第一个输入范围的起始迭代器(包含)InputIt1 end, // 第一个输入范围的结束迭代器(不包含)InputIt2 first2, // 第二个输入范围的起始迭代器(包含)OutputIt d, // 输出范围的起始迭代器35 行未改动1234567891011121314153 行未改动19202122232425262735 行未改动# P5733 【深基6.例1】自动修正[题目传送门](https://www.luogu.com.cn/problem/P5733)## 前置芝士本题要求我们把一个不包含空格的字符串小写字母转大写。在开始之前,我先介绍一个函数:在 STL 当中,`<algorithm>` 有个函数叫 `transform`,它可以将一个或多个输入范围的元素通过指定的操作转换后,存储到目标范围中,它主要有 $2$ 种重载形式。### 单输入范围这种形式用于对**一个输入范围的元素进行转换**,原型如下:```cpptemplate< class InputIt, class OutputIt, class UnaryOperation >OutputIt transform(InputIt first, // 输入范围的起始迭代器(包含)InputIt end, // 输入范围的结束迭代器(不包含)OutputIt d, // 输出范围的起始迭代器UnaryOperation op // 一元转换函数(接收一个参数,返回转换后的值)3 行未改动### 双输入范围这种形式用于对**两个输入范围的元素进行转换**,原型如下:·```cpptemplate< class InputIt1, class InputIt2, class OutputIt, class BinaryOperation >OutputIt transform(InputIt1 first, // 第一个输入范围的起始迭代器(包含)InputIt1 end, // 第一个输入范围的结束迭代器(不包含)InputIt2 first2, // 第二个输入范围的起始迭代器(包含)OutputIt d, // 输出范围的起始迭代器35 行未改动