【练习】3.22修改之前那个输出text第一段的程序,首先把text的第一段全部改成大写
#include <iostream>
#include<string>
#include<vector>
using namespace std;
vector<string> v6;
void first_paragraph(vector<string>text) {
//读取
string s;
while (getline(cin, s))
text.push_back(s);
//遍历全部字符串
for (auto it = text.begin();it != text.end() && !it->empty(); it++)
{
//遍历当前字符串
for(auto it1=it->begin();it1!=it->end();++it1)
*it1 = toupper(*it1);
cout << *it << endl;
}
}
int main() {
first_paragraph(v6);
}