3.17

一种方法:范围for语句:

#include <iostream>
#include <string>
#include <cctype>
#include <vector>
using namespace std;

int main()
{
	string word;
	vector<string> text;
	while (cin >> word)
	{
		text.push_back(word);
	}
	for (auto& c : text)
	{
		for (auto& d : c)
		{
			d = toupper(d);
		}
		cout << c << endl;
	}
	return 0;
}

另一种写法,用下标来写:


#include <iostream>
#include <string>
#include <cctype>
#include <vector>
using namespace std;

int main()
{
	string word;
	vector<string> text;

	while (cin >> word)
	{
		text.push_back(word);
	}
	for (vector<string>::size_type i = 0; i < text.size(); i++)
	{
		for (string::size_type j = 0; j < text[i].size(); j++)
		{
			text[i][j] = toupper(text[i][j]);
		}
		cout << text[i] << endl;
	}

	return 0;
}

再一种写法,迭代器来写:

#include <iostream>
#include <string>
#include <cctype>
#include <vector>
using namespace std;

int main()
{
	string word;
	vector<string> text;
	while (cin >> word)
	{
		text.push_back(word);
	}
	for (vector<string>::iterator iti = text.begin(); iti != text.end(); ++iti)
	{
		for (string::iterator itj = (*iti).begin(); itj != (*iti).end(); ++itj)
		{
			*itj = toupper(*itj);
		}
		cout << *iti << endl;
	}


	return 0;
}
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
libsvm-3.17是一个机器学习库,用于支持向量机(Support Vector Machines)的训练和预测。你可以通过在libsvm的网站上下载libsvm-3.12.zip文件,并将其解压到任意目录下,最好是放在MATLAB工具箱中,比如D:\program files (x86)\MATLAB\R2014a\toolbox\libsvm-3.22下。另外,你还需要安装相关软件,包括python3.2、libsvm3.17和gnuplot,并将其分别安装在指定的目录下,例如python3.2安装在d:/Python32,libsvm3.17安装在D:\libsvm-3.17,gnuplot安装在D:\gnuplot。 要在Windows上使用libsvm-3.17,你需要在命令窗口中输入"make"命令。虽然可能会出现找不到svmtrain.exp和svmpredict.exp的提示,但只要在libsvm/matlab目录下生成了四个文件(libsvmread.mexw32、libsvmwrite.mexw32、svmtrain.mexw32和svmpredict.mexw32),你就可以将这四个文件复制到..MATLAB\R2014a\toolbox\libsvm-3.22\windows目录下,替换原来的文件。 总结起来,libsvm-3.17是一个机器学习库,用于支持向量机的训练和预测。你需要下载并解压libsvm-3.12.zip文件,安装相关软件,并复制生成的四个文件到指定目录中,以便在MATLAB中使用libsvm-3.17。<span class="em">1</span><span class="em">2</span><span class="em">3</span> #### 引用[.reference_title] - *1* *3* [MATLAB R2014a 装 libsvm-3.17](https://blog.csdn.net/abc1942227359/article/details/77989988)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_1"}}] [.reference_item style="max-width: 50%"] - *2* [python3.2+libsvm3.17的配置](https://blog.csdn.net/laoyaotask/article/details/22654989)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_1"}}] [.reference_item style="max-width: 50%"] [ .reference_list ]
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值