<?xml version="1.0"?>
<rss version="2.0">
   <channel>
      <title>大樂透程式開發流程 by 20510廖苡薰</title>
      <link>https://padlet.com/s11035047/8rxo0rqqwnal8gj0</link>
      <description></description>
      <language>en-us</language>
      <pubDate>2023-03-30 01:27:09 UTC</pubDate>
      <lastBuildDate>2025-10-28 13:54:49 UTC</lastBuildDate>
      <webMaster>hello@padlet.com</webMaster>
      <image>
         <url></url>
      </image>
      <item>
         <title>1.抽籤/取亂數</title>
         <author>s11035047</author>
         <link>https://padlet.com/s11035047/8rxo0rqqwnal8gj0/wish/2537563518</link>
         <description><![CDATA[]]></description>
         <enclosure url="https://www.onlinegdb.com/CcGHqsRjb" />
         <pubDate>2023-03-30 01:30:49 UTC</pubDate>
         <guid>https://padlet.com/s11035047/8rxo0rqqwnal8gj0/wish/2537563518</guid>
      </item>
      <item>
         <title>2.將亂數排序 (Sort)</title>
         <author>s11035047</author>
         <link>https://padlet.com/s11035047/8rxo0rqqwnal8gj0/wish/2537566364</link>
         <description><![CDATA[]]></description>
         <enclosure url="https://www.onlinegdb.com/2UPPcaP5l" />
         <pubDate>2023-03-30 01:32:39 UTC</pubDate>
         <guid>https://padlet.com/s11035047/8rxo0rqqwnal8gj0/wish/2537566364</guid>
      </item>
      <item>
         <title>3.抽獎號碼不可以重覆</title>
         <author>s11035047</author>
         <link>https://padlet.com/s11035047/8rxo0rqqwnal8gj0/wish/2537568488</link>
         <description><![CDATA[]]></description>
         <enclosure url="https://www.onlinegdb.com/4qyztnCxI" />
         <pubDate>2023-03-30 01:34:12 UTC</pubDate>
         <guid>https://padlet.com/s11035047/8rxo0rqqwnal8gj0/wish/2537568488</guid>
      </item>
      <item>
         <title>4.N 期中獎號碼</title>
         <author>s11035047</author>
         <link>https://padlet.com/s11035047/8rxo0rqqwnal8gj0/wish/2537573318</link>
         <description><![CDATA[]]></description>
         <enclosure url="https://www.onlinegdb.com/Ieuzl1hvN" />
         <pubDate>2023-03-30 01:37:37 UTC</pubDate>
         <guid>https://padlet.com/s11035047/8rxo0rqqwnal8gj0/wish/2537573318</guid>
      </item>
      <item>
         <title>第一階段</title>
         <author>s11035047</author>
         <link>https://padlet.com/s11035047/8rxo0rqqwnal8gj0/wish/2537586432</link>
         <description><![CDATA[<div>先學習如何取亂數</div>]]></description>
         <enclosure url="" />
         <pubDate>2023-03-30 01:48:37 UTC</pubDate>
         <guid>https://padlet.com/s11035047/8rxo0rqqwnal8gj0/wish/2537586432</guid>
      </item>
      <item>
         <title>第二階段</title>
         <author>s11035047</author>
         <link>https://padlet.com/s11035047/8rxo0rqqwnal8gj0/wish/2537587428</link>
         <description><![CDATA[<div>再將取出來的亂數排序</div>]]></description>
         <enclosure url="" />
         <pubDate>2023-03-30 01:49:25 UTC</pubDate>
         <guid>https://padlet.com/s11035047/8rxo0rqqwnal8gj0/wish/2537587428</guid>
      </item>
      <item>
         <title>第三階段</title>
         <author>s11035047</author>
         <link>https://padlet.com/s11035047/8rxo0rqqwnal8gj0/wish/2537589956</link>
         <description><![CDATA[<div>因為是取亂數，每個數字被抽中的機率都相等，這次就是將重複抽到的數字去掉</div>]]></description>
         <enclosure url="" />
         <pubDate>2023-03-30 01:51:27 UTC</pubDate>
         <guid>https://padlet.com/s11035047/8rxo0rqqwnal8gj0/wish/2537589956</guid>
      </item>
      <item>
         <title>第四階段</title>
         <author>s11035047</author>
         <link>https://padlet.com/s11035047/8rxo0rqqwnal8gj0/wish/2537593106</link>
         <description><![CDATA[<div>開始分期，先詢問要分幾期再抽籤排序</div>]]></description>
         <enclosure url="" />
         <pubDate>2023-03-30 01:54:02 UTC</pubDate>
         <guid>https://padlet.com/s11035047/8rxo0rqqwnal8gj0/wish/2537593106</guid>
      </item>
      <item>
         <title>5. 加上特別號 </title>
         <author>s11035047</author>
         <link>https://padlet.com/s11035047/8rxo0rqqwnal8gj0/wish/2569563353</link>
         <description><![CDATA[]]></description>
         <enclosure url="https://onlinegdb.com/hoMcynj2EH" />
         <pubDate>2023-04-27 01:18:13 UTC</pubDate>
         <guid>https://padlet.com/s11035047/8rxo0rqqwnal8gj0/wish/2569563353</guid>
      </item>
      <item>
         <title>6. 選擇+條件判斷</title>
         <author>s11035047</author>
         <link>https://padlet.com/s11035047/8rxo0rqqwnal8gj0/wish/2569565149</link>
         <description><![CDATA[]]></description>
         <enclosure url="https://onlinegdb.com/-9a4v50Bc" />
         <pubDate>2023-04-27 01:19:21 UTC</pubDate>
         <guid>https://padlet.com/s11035047/8rxo0rqqwnal8gj0/wish/2569565149</guid>
      </item>
      <item>
         <title>第五階段</title>
         <author>s11035047</author>
         <link>https://padlet.com/s11035047/8rxo0rqqwnal8gj0/wish/2569567701</link>
         <description><![CDATA[<div>用第四階段的方法分出十期，不同的是，將每期都在新增一個特別號</div>]]></description>
         <enclosure url="" />
         <pubDate>2023-04-27 01:21:04 UTC</pubDate>
         <guid>https://padlet.com/s11035047/8rxo0rqqwnal8gj0/wish/2569567701</guid>
      </item>
      <item>
         <title>第六階段</title>
         <author>s11035047</author>
         <link>https://padlet.com/s11035047/8rxo0rqqwnal8gj0/wish/2569569772</link>
         <description><![CDATA[<div>來到兌獎環節，請使用者輸入自己的號碼後，再詢問要兌第幾期，告知有無中獎後再詢問使用者是否要繼續查詢</div>]]></description>
         <enclosure url="" />
         <pubDate>2023-04-27 01:22:27 UTC</pubDate>
         <guid>https://padlet.com/s11035047/8rxo0rqqwnal8gj0/wish/2569569772</guid>
      </item>
      <item>
         <title>程式碼解釋</title>
         <author>s11035047</author>
         <link>https://padlet.com/s11035047/8rxo0rqqwnal8gj0/wish/2606674784</link>
         <description><![CDATA[<ol><li><strong>std::srand(std::time(nullptr));</strong> - 這行設置隨機數生成器的種子。使用<strong>std::time(nullptr)</strong>將當前時間作為種子，以確保每次執行程式時生成的隨機數序列是不同的。</li><li><strong>int arr[6];</strong> - 宣告一個包含6個整數的數組<strong>arr</strong>，用於存儲偶數。</li><li><strong>int count = 0;</strong> - 初始化計數器<strong>count</strong>為0，用於跟踪已經生成的偶數的數量。</li><li><strong>while (count &lt; 6)</strong> - 進入循環，直到生成了6個偶數。</li><li><strong>int num = std::rand() % 100 + 1;</strong> - 使用<strong>std::rand()</strong>函數生成一個範圍在1到100之間的隨機數。</li><li><strong>if (num % 2 == 0)</strong> - 檢查生成的隨機數是否為偶數。</li><li><strong>arr[count] = num;</strong> - 如果生成的數字是偶數，將其存儲在數組<strong>arr</strong>的當前位置。</li><li><strong>count++;</strong> - 增加計數器，表示已經生成了一個偶數。</li><li><strong>std::cout &lt;&lt; "數組中的偶數：" &lt;&lt; std::endl;</strong> - 輸出提示訊息。</li><li><strong>for (int i = 0; i &lt; 6; i++)</strong> - 進入循環，遍歷數組<strong>arr</strong>中的元素。</li><li><strong>std::cout &lt;&lt; arr[i] &lt;&lt; " ";</strong> - 輸出數組<strong>arr</strong>中的元素。</li></ol><div><br></div>]]></description>
         <enclosure url="" />
         <pubDate>2023-05-27 05:34:41 UTC</pubDate>
         <guid>https://padlet.com/s11035047/8rxo0rqqwnal8gj0/wish/2606674784</guid>
      </item>
      <item>
         <title>程式碼解釋</title>
         <author>s11035047</author>
         <link>https://padlet.com/s11035047/8rxo0rqqwnal8gj0/wish/2606679186</link>
         <description><![CDATA[<ol><li><strong>std::random_device rd;</strong> - 創建一個隨機設備，用於生成種子。</li><li><strong>std::mt19937 gen(rd());</strong> - 創建一個名為<strong>gen</strong>的Mersenne Twister隨機數生成器，並將隨機設備作為種子。</li><li><strong>std::uniform_int_distribution&lt;int&gt; dis(1, 49);</strong> - 創建一個均勻分佈的整數生成器<strong>dis</strong>，生成範圍在1到49之間的整數。</li><li><strong>int arr[6];</strong> - 宣告一個包含6個整數的數組<strong>arr</strong>，用於存儲生成的亂數。</li><li><strong>for (int i = 0; i &lt; 6; i++)</strong> - 進入循環，生成6個亂數。</li><li><strong>arr[i] = dis(gen);</strong> - 使用均勻分佈的整數生成器<strong>dis</strong>生成一個隨機數，並將其存儲在數組<strong>arr</strong>的當前位置。</li><li><strong>std::sort(arr, arr + 6);</strong> - 使用<strong>std::sort</strong>函數對數組<strong>arr</strong>中的元素進行排序。</li><li><strong>int result[6];</strong> - 宣告一個包含6個整數的數組<strong>result</strong>，用於存儲排序後的結果。</li><li><strong>for (int i = 0; i &lt; 6; i++)</strong> - 進入循環，將排序後的數組<strong>arr</strong>複製到數組<strong>result</strong>中。</li><li><strong>std::cout &lt;&lt; "結果：" &lt;&lt; std::endl;</strong> - 輸出提示訊息。</li><li><strong>for (int i = 0; i &lt; 6; i++)</strong> - 進入循環，遍歷數組<strong>result</strong>中的元素。</li><li><strong>std::cout &lt;&lt; result[i] &lt;&lt; " ";</strong> - 輸出數組<strong>result</strong>中的元素。</li></ol><div><br></div>]]></description>
         <enclosure url="" />
         <pubDate>2023-05-27 05:57:49 UTC</pubDate>
         <guid>https://padlet.com/s11035047/8rxo0rqqwnal8gj0/wish/2606679186</guid>
      </item>
      <item>
         <title>程式碼解釋</title>
         <author>s11035047</author>
         <link>https://padlet.com/s11035047/8rxo0rqqwnal8gj0/wish/2606684604</link>
         <description><![CDATA[<ol><li><strong>srand(time(0));</strong> - 設置亂數種子，使用當前時間作為種子，確保每次執行程式時生成的隨機數序列不同。</li><li><strong>int i, j, num[10];</strong> - 宣告變數 i、j 和一個長度為 10 的整數陣列 num，用於存儲生成的隨機整數。</li><li><strong>for (i = 1 ; i &lt;= 10 ; i++)</strong> - 使用 for 迴圈依次生成 10 個隨機整數。</li><li><strong>do { ... } while (j != i);</strong> - 使用 do...while 循環確保生成的隨機整數不重複。</li><li><strong>num[i-1] = rand() % 10 + 1;</strong> - 使用 rand() 函數生成一個 1 到 10 之間的隨機整數，並將其存儲在陣列 num 的當前位置。</li><li><strong>for (j = 1 ; j &lt; i ; j++)</strong> - 使用 for 迴圈遍歷已經生成的隨機整數，檢查是否有重複。</li><li><strong>if (num[i-1] == num[j-1]) break;</strong> - 如果新生成的隨機整數已經存在於之前生成的整數中，則跳出內部循環。</li><li><strong>std::cout &lt;&lt; num[i-1] &lt;&lt; std::endl;</strong> - 輸出新生成的隨機整數。</li></ol><div><br></div>]]></description>
         <enclosure url="" />
         <pubDate>2023-05-27 06:24:31 UTC</pubDate>
         <guid>https://padlet.com/s11035047/8rxo0rqqwnal8gj0/wish/2606684604</guid>
      </item>
      <item>
         <title>程式碼解釋</title>
         <author>s11035047</author>
         <link>https://padlet.com/s11035047/8rxo0rqqwnal8gj0/wish/2606691185</link>
         <description><![CDATA[<ol><li><strong>srand(time(0))</strong>：設置亂數種子，使用當前時間作為種子，確保每次執行程式時生成的隨機數序列不同。</li><li><strong>std::cout &lt;&lt; "需要抽出幾期? ";</strong>：輸出提示消息，詢問要抽取幾期的樂透號碼。</li><li><strong>std::cin &gt;&gt; n;</strong>：讀取用戶輸入的數字，存儲在變數 <strong>n</strong> 中，表示要抽取的樂透號碼期數。</li><li><strong>for (int k = 1; k &lt;= n; k++)</strong>：使用 for 迴圈依次生成指定數量的樂透號碼。</li><li><strong>int i, j, num[10];</strong>：定義變數 <strong>i</strong>、<strong>j</strong> 和一個長度為 10 的整數陣列 <strong>num</strong>，用於存儲生成的隨機整數。</li><li><strong>int result[6];</strong>：定義一個長度為 6 的整數陣列 <strong>result</strong>，用於存儲排序後的樂透號碼。</li><li><strong>for (i = 1; i &lt;= 10; i++)</strong>：使用 for 迴圈依次生成 10 個隨機整數。</li><li><strong>do { ... } while (j != i);</strong>：使用 do...while 循環確保生成的隨機整數不重複。</li><li><strong>num[i - 1] = rand() % 49 + 1;</strong>：使用 rand() 函數生成一個 1 到 49 之間的隨機整數，並將其存儲在陣列 <strong>num</strong> 的</li></ol><div><br></div>]]></description>
         <enclosure url="" />
         <pubDate>2023-05-27 06:52:29 UTC</pubDate>
         <guid>https://padlet.com/s11035047/8rxo0rqqwnal8gj0/wish/2606691185</guid>
      </item>
      <item>
         <title>程式碼解釋</title>
         <author>s11035047</author>
         <link>https://padlet.com/s11035047/8rxo0rqqwnal8gj0/wish/2606691806</link>
         <description><![CDATA[<ol><li><strong>srand(time(0))</strong>：設置亂數種子，使用當前時間作為種子，確保每次執行程式時生成的隨機數序列不同。</li><li><strong>int i, j, num[7];</strong>：定義變數 <strong>i</strong>、<strong>j</strong> 和一個長度為 7 的整數陣列 <strong>num</strong>，用於存儲生成的隨機整數，其中最後一個位置用於存儲特別號。</li><li><strong>int result[6];</strong>：定義一個長度為 6 的整數陣列 <strong>result</strong>，用於存儲排序後的樂透號碼。</li><li><strong>for (int k = 1; k &lt;= 10; k++)</strong>：使用 for 迴圈依次生成 10 個樂透號碼組合。</li><li><strong>for (i = 1; i &lt;= 7; i++)</strong>：使用 for 迴圈依次生成 7 個隨機整數，其中最後一個位置用於特別號。</li><li><strong>do { ... } while (j != i);</strong>：使用 do...while 循環確保生成的隨機整數不重複。</li><li><strong>num[i - 1] = rand() % 49 + 1;</strong>：使用 rand() 函數生成一個 1 到 49 之間的隨機整數，並將其存儲在陣列 <strong>num</strong> 的當前位置。</li><li><strong>for (j = 1; j &lt; i; j++)</strong>：使用 for 迴圈遍歷已經生成的隨機整數，檢查是否有重複。</li><li><strong>if (num[i - 1] == num[j - 1]) break;</strong>：如果新生成的隨機整數已經存在於之前生成的整數中，則跳出內部迴圈。</li><li><strong>if (i != 7) { ... } else { ... }</strong>：檢查是否為特別號的位置，如果不是，可以在此處執行其他操作。</li><li><strong>std::sort(num, num + 6);</strong>：使用 <strong>std::sort</strong> 函數對 <strong>num</strong> 陣列中前六個數字進行排序，從小到大排列。</li><li><strong>std::cout &lt;&lt; "第 " &lt;&lt; k &lt;&lt; " 期: ";</strong>：輸出當前期數的提示消息。</li><li><strong>for (j = 0; j &lt; 6; j++) { ... }</strong>：遍歷排序後的樂透號碼，並輸出到終端。</li><li><strong>std::cout &lt;&lt; std::endl &lt;&lt; std::endl;</strong>：輸出兩個換行符，用於區分不同期數的樂透號碼。</li></ol><div><br></div>]]></description>
         <enclosure url="" />
         <pubDate>2023-05-27 06:54:27 UTC</pubDate>
         <guid>https://padlet.com/s11035047/8rxo0rqqwnal8gj0/wish/2606691806</guid>
      </item>
      <item>
         <title>程式碼解釋</title>
         <author>s11035047</author>
         <link>https://padlet.com/s11035047/8rxo0rqqwnal8gj0/wish/2607042554</link>
         <description><![CDATA[<ol><li>使用 <strong>srand(time(0))</strong> 設定亂數種子，以確保每次執行時產生的亂數序列都不同。</li><li>宣告一個陣列 <strong>num</strong>，用來存儲從 1 到 49 的數字。</li><li>進行一個迴圈，從 1 到 49，每次迴圈生成一個亂數，並檢查亂數是否已經出現過，以避免重複的號碼。</li><li>宣告一個陣列 <strong>result</strong>，用來存儲使用者輸入的六個號碼。</li><li>讓使用者輸入六個介於 1 到 49 之間的號碼，並將其存入 <strong>result</strong> 陣列中。</li><li>使用 <strong>std::sort</strong> 函數對 <strong>result</strong> 陣列進行排序，以便後續比對。</li><li>讓使用者輸入要查詢的期數，並進行輸入驗證，確保期數在 1 到 10 之間。</li><li>進行 10 次迴圈，從 1 到 10，每次迴圈產生一組中獎號碼，並與使用者輸入的號碼進行比對。</li><li>如果迴圈的次數與使用者輸入的期數相符，則顯示該期的中獎號碼。</li><li>檢查使用者輸入的號碼與中獎號碼的匹配情況，並計算匹配的數量。</li><li>根據匹配的數量判斷是否中獎，並輸出相應的結果。</li><li>詢問使用者是否繼續查詢，如果回答是，則重新執行 <strong>main()</strong> 函數，否則結束程式。</li></ol><div><br></div>]]></description>
         <enclosure url="" />
         <pubDate>2023-05-28 05:13:31 UTC</pubDate>
         <guid>https://padlet.com/s11035047/8rxo0rqqwnal8gj0/wish/2607042554</guid>
      </item>
   </channel>
</rss>
