⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 cpp05.cpp

📁 C++参考书
💻 CPP
字号:

// Coded by plusir -- Jan.11.2003.
// Standard C++ Bible -- (P596-22-5)

#include <iostream>
#include <algorithm>
#include <set>
using namespace std ;

int main()
{
	set<char> charSet1, charSet2 ;

	for ( int i = 0; i < 5; ++i ) {
		charSet1.insert( 65 + i ) ;
		charSet2.insert( 70 + i ) ;
	}

	ostream_iterator<char> output( cout, " " ) ;
	cout << "Contents of first set: " ;
	copy( charSet1.begin(), charSet1.end(), output ) ;
	cout << endl ;
	cout << "Contents of secon set: " ;
	copy( charSet2.begin(), charSet2.end(), output ) ;
	cout << endl << endl ;

	cout << "set1 " ;
	cout << ( charSet1 == charSet2 ? "==" : ( charSet1 < charSet2 ? "<" : ">" ) ) ;
	cout << " set2" << endl ;

	return 0 ;
}

⌨️ 快捷键说明

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