苏州科建设交通学院网站,张雪峰谈广告类专业,超市网站建设费用,微信上登录网站同步怎么做今天在复习C的时候偶然看到这个题目#xff0c;要求是使用C完成大写转换然后存放到vector中去#xff1a; 这里也是使用了一个string库#xff0c;但不知道为什么string库里并没有自带大小写转化#xff0c;只得使用algorithm库的transform函数来进行大小写转化
#include的时候偶然看到这个题目要求是使用C完成大写转换然后存放到vector中去 这里也是使用了一个string库但不知道为什么string库里并没有自带大小写转化只得使用algorithm库的transform函数来进行大小写转化
#includeiostream
#includevector
#includestring
#includealgorithm
using namespace std;
int main()
{string s;cout please enter a sreies of words to build a sentence\nendl;vectorstring text;cins;transform(s.begin(), s.end(), s.begin(), ::toupper); coutnow the transform is sendl;}