<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="th">
	<id>http://158.108.32.49/wiki/index.php?action=history&amp;feed=atom&amp;title=Adt_lab%2Fstl_sets_and_maps</id>
	<title>Adt lab/stl sets and maps - ประวัติรุ่นแก้ไข</title>
	<link rel="self" type="application/atom+xml" href="http://158.108.32.49/wiki/index.php?action=history&amp;feed=atom&amp;title=Adt_lab%2Fstl_sets_and_maps"/>
	<link rel="alternate" type="text/html" href="http://158.108.32.49/wiki/index.php?title=Adt_lab/stl_sets_and_maps&amp;action=history"/>
	<updated>2026-04-20T13:47:14Z</updated>
	<subtitle>ประวัติรุ่นแก้ไขของหน้านี้ในวิกิ</subtitle>
	<generator>MediaWiki 1.33.1</generator>
	<entry>
		<id>http://158.108.32.49/wiki/index.php?title=Adt_lab/stl_sets_and_maps&amp;diff=56423&amp;oldid=prev</id>
		<title>Jittat: หน้าที่ถูกสร้างด้วย &#039;: &#039;&#039;This is part of adt lab.&#039;&#039;  == Examples ==  &#039;&#039;&#039;set&#039;&#039;&#039; - insert and find  &lt;source lang=&quot;cpp&quot;&gt; #include &lt;set&gt; #include &lt;iostream&gt;...&#039;</title>
		<link rel="alternate" type="text/html" href="http://158.108.32.49/wiki/index.php?title=Adt_lab/stl_sets_and_maps&amp;diff=56423&amp;oldid=prev"/>
		<updated>2015-11-27T04:02:21Z</updated>

		<summary type="html">&lt;p&gt;หน้าที่ถูกสร้างด้วย &amp;#039;: &amp;#039;&amp;#039;This is part of &lt;a href=&quot;/wiki/index.php/Adt_lab&quot; title=&quot;Adt lab&quot;&gt;adt lab&lt;/a&gt;.&amp;#039;&amp;#039;  == Examples ==  &amp;#039;&amp;#039;&amp;#039;set&amp;#039;&amp;#039;&amp;#039; - insert and find  &amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt; #include &amp;lt;set&amp;gt; #include &amp;lt;iostream&amp;gt;...&amp;#039;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;หน้าใหม่&lt;/b&gt;&lt;/p&gt;&lt;div&gt;: &amp;#039;&amp;#039;This is part of [[adt lab]].&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
== Examples ==&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;set&amp;#039;&amp;#039;&amp;#039; - insert and find&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
#include &amp;lt;set&amp;gt;&lt;br /&gt;
#include &amp;lt;iostream&amp;gt;&lt;br /&gt;
&lt;br /&gt;
using namespace std;&lt;br /&gt;
&lt;br /&gt;
set&amp;lt;int&amp;gt; s;&lt;br /&gt;
&lt;br /&gt;
main()&lt;br /&gt;
{&lt;br /&gt;
  s.insert(10);&lt;br /&gt;
  s.insert(20);&lt;br /&gt;
  s.insert(1000);&lt;br /&gt;
  s.insert(25);&lt;br /&gt;
&lt;br /&gt;
  cout &amp;lt;&amp;lt; (s.find(1) != s.end()) &amp;lt;&amp;lt; endl;&lt;br /&gt;
  cout &amp;lt;&amp;lt; (s.find(2) != s.end()) &amp;lt;&amp;lt; endl;&lt;br /&gt;
  cout &amp;lt;&amp;lt; (s.find(10) != s.end()) &amp;lt;&amp;lt; endl;&lt;br /&gt;
  cout &amp;lt;&amp;lt; (s.find(50) != s.end()) &amp;lt;&amp;lt; endl;&lt;br /&gt;
  cout &amp;lt;&amp;lt; (s.find(1000) != s.end()) &amp;lt;&amp;lt; endl;&lt;br /&gt;
&lt;br /&gt;
  for(set&amp;lt;int&amp;gt;::iterator i = s.begin();&lt;br /&gt;
      i != s.end();&lt;br /&gt;
      i++) {&lt;br /&gt;
    cout &amp;lt;&amp;lt; *i &amp;lt;&amp;lt; endl;&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;set&amp;#039;&amp;#039;&amp;#039; - using pair to prevent key clashing&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
#include &amp;lt;set&amp;gt;&lt;br /&gt;
#include &amp;lt;iostream&amp;gt;&lt;br /&gt;
&lt;br /&gt;
using namespace std;&lt;br /&gt;
&lt;br /&gt;
int n;&lt;br /&gt;
typedef pair&amp;lt;int,int&amp;gt; int_pair;&lt;br /&gt;
&lt;br /&gt;
set&amp;lt;int_pair&amp;gt; s;&lt;br /&gt;
&lt;br /&gt;
main()&lt;br /&gt;
{&lt;br /&gt;
  cin &amp;gt;&amp;gt; n;&lt;br /&gt;
  for(int i=0; i&amp;lt;n; i++) {&lt;br /&gt;
    int x;&lt;br /&gt;
    cin &amp;gt;&amp;gt; x;&lt;br /&gt;
    s.insert(make_pair(x,i));&lt;br /&gt;
  }&lt;br /&gt;
  for(set&amp;lt;int_pair&amp;gt;::iterator i = s.begin();&lt;br /&gt;
      i != s.end(); i++) {&lt;br /&gt;
    cout &amp;lt;&amp;lt; i-&amp;gt;first &amp;lt;&amp;lt; endl;&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;map&amp;#039;&amp;#039;&amp;#039; - insertion and find&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
#include &amp;lt;map&amp;gt;&lt;br /&gt;
#include &amp;lt;iostream&amp;gt;&lt;br /&gt;
&lt;br /&gt;
using namespace std;&lt;br /&gt;
&lt;br /&gt;
map&amp;lt;int,int&amp;gt; m;&lt;br /&gt;
&lt;br /&gt;
main()&lt;br /&gt;
{&lt;br /&gt;
  m[100] = 0;&lt;br /&gt;
  m[200] = 1000;&lt;br /&gt;
  m[1000000000] = -1;&lt;br /&gt;
  m[10000000] = 12345;&lt;br /&gt;
&lt;br /&gt;
  cout &amp;lt;&amp;lt; m[10000000] &amp;lt;&amp;lt; endl;&lt;br /&gt;
&lt;br /&gt;
  cout &amp;lt;&amp;lt; (m.find(1000) != m.end()) &amp;lt;&amp;lt; endl;&lt;br /&gt;
&lt;br /&gt;
  for(map&amp;lt;int,int&amp;gt;::iterator i = m.begin();&lt;br /&gt;
      i != m.end(); i++) {&lt;br /&gt;
    cout &amp;lt;&amp;lt; i-&amp;gt;first &amp;lt;&amp;lt; &amp;quot; -&amp;gt; &amp;quot; &amp;lt;&amp;lt; i-&amp;gt;second &amp;lt;&amp;lt; endl;&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;/div&gt;</summary>
		<author><name>Jittat</name></author>
		
	</entry>
</feed>