settest.cpp

来自「STL 教程-Set使用方法演示」· C++ 代码 · 共 37 行

CPP
37
字号
// setTest.cpp : Defines the entry point for the console application.
//

#include "stdafx.h"
#include <set>
#include <string>
#include <iostream>
using namespace std;


int main(int argc, char* argv[])
{
	set<string> strSet;
	set<string>::iterator it;
	strSet.insert("Orange");
	strSet.insert("Apple");
	strSet.insert("Banana");
	strSet.insert("AHello");
	strSet.insert("AHello");

	for (it=strSet.begin();it!=strSet.end();it++)
	{
		cout<<*it<<endl;
	}


	
	
	
	
	
	
	printf("Hello World!\n");
	return 0;
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?