![](https://img-blog.csdnimg.cn/20201014180756925.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
C++primer习题解答
阿杜
这个作者很懒,什么都没留下…
展开
-
逗号表达式------将输入字符串顺序反转
逗号表达式应用------将输入字符串顺序反转逗号表达式对表达式完成同样的任务,允许将两个表达式放到c++句法只允许放一个表达式的地方。例如,假设有一个循环,每一轮将一个变量加一,而将另一个变量减一。这种情况下可用逗号表达式将两个表达式合并为一个。==话不多说。直接放代码=#include<iostream>#include <string>int main(){ std::string str; std::cout<<"please input a s原创 2020-08-07 11:57:24 · 266 阅读 · 0 评论 -
从cin读入一组词存入Vector对象。然后把所有词转换为大写形式
从cin读入一组词存入Vector对象。然后把所有词转换为大写形式知识点:向vector对象中添加元素,C11 for循环语句,topper函数使用将词改为大写#include <iostream>#include <vector>#include <string>int main(){ std::vector<std::string> vString; std::string s; char count = 'y'; std:原创 2020-08-06 21:06:20 · 360 阅读 · 0 评论