- 新增现代 C++ 教程的 Preface 章节,包括英文和中文版本 - 添加 C++ Primer 练习代码 - 新增 Learn C++ 教程的 C++ 开发简介章节 - 添加头文件解析文档 - 更新 mkdocs.yml,包含新教程的目录结构 - 修改项目设置,使用 Python 3.10环境
23 lines
561 B
C++
23 lines
561 B
C++
#include <iostream>
|
||
#include <string>
|
||
#include <vector>
|
||
|
||
using namespace std;
|
||
using std::vector;
|
||
|
||
int main() {
|
||
vector<string> v;
|
||
string w;
|
||
cout << "请输入一段话" << endl;
|
||
|
||
while (getline(cin, w)) { //利用getline读取一句话,直接回车产生一个空串,表示段落结束
|
||
v.push_back(w);
|
||
}
|
||
for(auto it = v.begin(); it != v.end() && !it -> empty();it++) {
|
||
for (auto it2 = it->begin(); it2 != it->end(); it2++){
|
||
*it2 = toupper(*it2);
|
||
}
|
||
cout << *it << endl;
|
||
}
|
||
return 0;
|
||
} |