<?xml version="1.0"?>
<rss version="2.0">
   <channel>
      <title>大樂透程式開發流程 by 20619宋承曄</title>
      <link>https://padlet.com/s11030064/veue7isof4f3topc</link>
      <description>111(2) 高二C班課程</description>
      <language>en-us</language>
      <pubDate>2023-03-30 00:41:17 UTC</pubDate>
      <lastBuildDate>2025-11-30 14:57:49 UTC</lastBuildDate>
      <webMaster>hello@padlet.com</webMaster>
      <image>
         <url></url>
      </image>
      <item>
         <title>程式碼連結</title>
         <author>s11030064</author>
         <link>https://padlet.com/s11030064/veue7isof4f3topc/wish/2537497856</link>
         <description><![CDATA[]]></description>
         <enclosure url="https://onlinegdb.com/KqX-JLM7E" />
         <pubDate>2023-03-30 00:42:54 UTC</pubDate>
         <guid>https://padlet.com/s11030064/veue7isof4f3topc/wish/2537497856</guid>
      </item>
      <item>
         <title>程式碼連結</title>
         <author>s11030064</author>
         <link>https://padlet.com/s11030064/veue7isof4f3topc/wish/2537499313</link>
         <description><![CDATA[]]></description>
         <enclosure url="https://www.onlinegdb.com/AtIdKsQm0" />
         <pubDate>2023-03-30 00:44:01 UTC</pubDate>
         <guid>https://padlet.com/s11030064/veue7isof4f3topc/wish/2537499313</guid>
      </item>
      <item>
         <title>程式碼連結</title>
         <author>s11030064</author>
         <link>https://padlet.com/s11030064/veue7isof4f3topc/wish/2537499889</link>
         <description><![CDATA[]]></description>
         <enclosure url="https://onlinegdb.com/YtCHi3rjC" />
         <pubDate>2023-03-30 00:44:23 UTC</pubDate>
         <guid>https://padlet.com/s11030064/veue7isof4f3topc/wish/2537499889</guid>
      </item>
      <item>
         <title>程式碼連結</title>
         <author>s11030064</author>
         <link>https://padlet.com/s11030064/veue7isof4f3topc/wish/2537500455</link>
         <description><![CDATA[]]></description>
         <enclosure url="https://www.onlinegdb.com/JNPVAGGjX" />
         <pubDate>2023-03-30 00:44:47 UTC</pubDate>
         <guid>https://padlet.com/s11030064/veue7isof4f3topc/wish/2537500455</guid>
      </item>
      <item>
         <title>目標</title>
         <author>s11030064</author>
         <link>https://padlet.com/s11030064/veue7isof4f3topc/wish/2537501852</link>
         <description><![CDATA[<div><strong>六個 1~100 的 "偶數" 變數,存於陣列中,並列印出來 (數量/範圍/條件)</strong></div>]]></description>
         <enclosure url="" />
         <pubDate>2023-03-30 00:45:52 UTC</pubDate>
         <guid>https://padlet.com/s11030064/veue7isof4f3topc/wish/2537501852</guid>
      </item>
      <item>
         <title>目標</title>
         <author>s11030064</author>
         <link>https://padlet.com/s11030064/veue7isof4f3topc/wish/2537502454</link>
         <description><![CDATA[<div>1. <strong>產生</strong>一組抽獎號(1-49)<br>2. 將產生的抽獎號加上<strong>排序</strong> (由小到大)<br>3. 將排序前後的<strong>陣列(result) </strong>結果印出來(以<strong>陣列/串列</strong>儲存)</div>]]></description>
         <enclosure url="" />
         <pubDate>2023-03-30 00:46:17 UTC</pubDate>
         <guid>https://padlet.com/s11030064/veue7isof4f3topc/wish/2537502454</guid>
      </item>
      <item>
         <title>目標</title>
         <author>s11030064</author>
         <link>https://padlet.com/s11030064/veue7isof4f3topc/wish/2537504564</link>
         <description><![CDATA[<div><strong>1. 檢查陣列中的資料, 確認號碼不重覆<br>2. 如果陣列中已經有該筆資料，即重新取亂數</strong></div>]]></description>
         <enclosure url="" />
         <pubDate>2023-03-30 00:47:59 UTC</pubDate>
         <guid>https://padlet.com/s11030064/veue7isof4f3topc/wish/2537504564</guid>
      </item>
      <item>
         <title>目標</title>
         <author>s11030064</author>
         <link>https://padlet.com/s11030064/veue7isof4f3topc/wish/2537509656</link>
         <description><![CDATA[<div>1.於程式開始運行時詢問需要抽出幾期的大樂透號碼<br>2.將得到的數字作為取亂數的輪數並將結果分別儲存進陣列<br>3. 每產生一輪，以該輪輸出該期號碼<br>4.須利用int n; //抽出輪數</div>]]></description>
         <enclosure url="" />
         <pubDate>2023-03-30 00:52:11 UTC</pubDate>
         <guid>https://padlet.com/s11030064/veue7isof4f3topc/wish/2537509656</guid>
      </item>
      <item>
         <title>程式碼連結</title>
         <author>s11030064</author>
         <link>https://padlet.com/s11030064/veue7isof4f3topc/wish/2560838069</link>
         <description><![CDATA[]]></description>
         <enclosure url="https://onlinegdb.com/liSwmZz1C" />
         <pubDate>2023-04-20 00:18:40 UTC</pubDate>
         <guid>https://padlet.com/s11030064/veue7isof4f3topc/wish/2560838069</guid>
      </item>
      <item>
         <title>目標</title>
         <author>s11030064</author>
         <link>https://padlet.com/s11030064/veue7isof4f3topc/wish/2569487995</link>
         <description><![CDATA[<div>1.於程式開始運行時產出10期大樂透抽獎號碼，然後詢問需要第幾期的大樂透號碼進行兌獎<br>2.將得到的數字取出大樂透抽獎號碼，並以[第Ｘ期中獎號碼：xx. xx. xx. xx. xx. xx / 特別號：xx]的形式輸出<br>3.將取出亂數的數量改為7個，並將存於數列中的第一個數字不進行排序<br>4.將不進行排序的數字做為特別號，其他則為中獎號碼</div>]]></description>
         <enclosure url="" />
         <pubDate>2023-04-27 00:16:55 UTC</pubDate>
         <guid>https://padlet.com/s11030064/veue7isof4f3topc/wish/2569487995</guid>
      </item>
      <item>
         <title>程式碼連結</title>
         <author>s11030064</author>
         <link>https://padlet.com/s11030064/veue7isof4f3topc/wish/2569499520</link>
         <description><![CDATA[]]></description>
         <enclosure url="https://onlinegdb.com/55JkHBvlL" />
         <pubDate>2023-04-27 00:25:46 UTC</pubDate>
         <guid>https://padlet.com/s11030064/veue7isof4f3topc/wish/2569499520</guid>
      </item>
      <item>
         <title>目標</title>
         <author>s11030064</author>
         <link>https://padlet.com/s11030064/veue7isof4f3topc/wish/2569509790</link>
         <description><![CDATA[<div>1.於程式開始運行時產出10期大樂透抽獎號碼，然後先詢問需兌獎的期別，後詢問使用者於該期的大樂透號碼<br>2.將得到的結果確認該期的大樂透抽獎號碼，並以[第Ｘ期/xx：中獎(沒中獎)]的形式輸出，中獎或沒中獎的輸出視使用者於該期的大樂透號碼是否於該陣列中<br>3.於輸出完畢後，詢問是否繼續，如果是再次先詢問需兌獎的期別，後詢問使用者於該期的大樂透號碼</div>]]></description>
         <enclosure url="" />
         <pubDate>2023-04-27 00:34:02 UTC</pubDate>
         <guid>https://padlet.com/s11030064/veue7isof4f3topc/wish/2569509790</guid>
      </item>
      <item>
         <title>程式碼</title>
         <author>s11030064</author>
         <link>https://padlet.com/s11030064/veue7isof4f3topc/wish/2612595215</link>
         <description><![CDATA[<div>/*************************<br>#&nbsp; 高二進階程式設計 &nbsp; *<br>#&nbsp; &nbsp; 大樂透程式開發&nbsp; &nbsp; &nbsp;*<br>#&nbsp; &nbsp; &nbsp; 206-19-宋承曄&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; *<br>#&nbsp; &nbsp; &lt;抽籤/取亂數 &gt;&nbsp; &nbsp; &nbsp; *<br>**************************/<br>#include &lt;iostream&gt;<br>#include &lt;cstdlib&gt;<br>#include &lt;ctime&gt;<br>using namespace std;<br><br>int main() {<br>&nbsp; &nbsp; int evenNumbers[50];<br>&nbsp; &nbsp; int counter = 0;<br>&nbsp; &nbsp; srand(time(0));<br><br>&nbsp; &nbsp; for (int i = 1; i &lt;= 100; i++) {<br>&nbsp; &nbsp; &nbsp; &nbsp; if (i % 2 == 0) {<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; evenNumbers[counter++] = i;<br>&nbsp; &nbsp; &nbsp; &nbsp; }<br>&nbsp; &nbsp; }<br><br>&nbsp; &nbsp; int randomNumbers[6];<br>&nbsp; &nbsp; for (int i = 0; i &lt; 6; i++) {<br>&nbsp; &nbsp; &nbsp; &nbsp; int index = rand() % counter;<br>&nbsp; &nbsp; &nbsp; &nbsp; randomNumbers[i] = evenNumbers[index];<br>&nbsp; &nbsp; &nbsp; &nbsp; counter--;<br>&nbsp; &nbsp; &nbsp; &nbsp; evenNumbers[index] = evenNumbers[counter];<br>&nbsp; &nbsp; }<br><br>&nbsp; &nbsp; cout &lt;&lt; "Random even numbers: ";<br>&nbsp; &nbsp; for (int i = 0; i &lt; 6; i++) {<br>&nbsp; &nbsp; &nbsp; &nbsp; cout &lt;&lt; randomNumbers[i] &lt;&lt; " ";<br>&nbsp; &nbsp; }<br>&nbsp; &nbsp; return 0;<br>}<br><br></div>]]></description>
         <enclosure url="" />
         <pubDate>2023-06-02 05:23:02 UTC</pubDate>
         <guid>https://padlet.com/s11030064/veue7isof4f3topc/wish/2612595215</guid>
      </item>
      <item>
         <title>程式碼</title>
         <author>s11030064</author>
         <link>https://padlet.com/s11030064/veue7isof4f3topc/wish/2612606657</link>
         <description><![CDATA[<div>/**********************<br>*&nbsp; 高二進階程式設計 &nbsp; *<br>* &nbsp; 大樂透程式開發&nbsp; *<br>* &nbsp; 206-19-宋承曄&nbsp; &nbsp; *<br>*&nbsp; &lt;六個數字的排序&gt; &nbsp; *<br>**********************/<br>#include &lt;iostream&gt;<br>#include &lt;cstdlib&gt;&nbsp;<br>#include &lt;ctime&gt;&nbsp;<br>using namespace std;<br><br>// 氣泡排序法函數<br>void bubbleSort(int arr[], int n) {<br>&nbsp; &nbsp; for (int i = 0; i &lt; n - 1; i++) {<br>&nbsp; &nbsp; &nbsp; &nbsp; for (int j = 0; j &lt; n - i - 1; j++) {<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if (arr[j] &gt; arr[j + 1]) {<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; // 如果相鄰的元素順序錯誤，則交換它們的位置<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; int temp = arr[j];<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; arr[j] = arr[j + 1];<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; arr[j + 1] = temp;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br>&nbsp; &nbsp; &nbsp; &nbsp; }<br>&nbsp; &nbsp; }<br>}<br><br>int main() {<br>&nbsp; &nbsp; const int SIZE = 6;<br>&nbsp; &nbsp; int arr[SIZE];<br><br>&nbsp; &nbsp; srand(time(nullptr));<br><br>&nbsp; &nbsp; // 隨機生成6個1~49之間的數字<br>&nbsp; &nbsp; for (int i = 0; i &lt; SIZE; i++) {<br>&nbsp; &nbsp; &nbsp; &nbsp; arr[i] = rand() % 49 + 1;<br>&nbsp; &nbsp; }<br><br>&nbsp; &nbsp; &nbsp;// 輸出排序前的數組<br>&nbsp; &nbsp; cout &lt;&lt; "排序前的數組：";<br>&nbsp; &nbsp; &nbsp; &nbsp; for (int i = 0; i &lt; SIZE; i++) {<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; cout &lt;&lt; arr[i] &lt;&lt; " ";<br>&nbsp; &nbsp; &nbsp;}<br>&nbsp; &nbsp; cout &lt;&lt; endl;<br><br>&nbsp; &nbsp; // 使用氣泡排序法對數組進行排序<br>&nbsp; &nbsp; bubbleSort(arr, SIZE);<br><br>&nbsp; &nbsp; // 輸出排序後的數組<br>&nbsp; &nbsp; cout &lt;&lt; "排序後的數組：";<br>&nbsp; &nbsp; for (int i = 0; i &lt; SIZE; i++) {<br>&nbsp; &nbsp; &nbsp; &nbsp; cout &lt;&lt; arr[i] &lt;&lt; " ";<br>&nbsp; &nbsp; }<br>&nbsp; &nbsp; cout &lt;&lt; endl;<br><br>&nbsp; &nbsp; return 0;<br>}<br><br></div>]]></description>
         <enclosure url="" />
         <pubDate>2023-06-02 05:37:13 UTC</pubDate>
         <guid>https://padlet.com/s11030064/veue7isof4f3topc/wish/2612606657</guid>
      </item>
      <item>
         <title>程式碼</title>
         <author>s11030064</author>
         <link>https://padlet.com/s11030064/veue7isof4f3topc/wish/2612607087</link>
         <description><![CDATA[<div>/**********************<br>*&nbsp; 高二進階程式設計 &nbsp; *<br>* &nbsp; 大樂透程式開發&nbsp; *<br>* &nbsp; 206-19-宋承曄&nbsp; &nbsp; *<br>*&nbsp; &nbsp; &lt;號碼不重覆&nbsp; &gt;&nbsp; *<br>**********************/<br>#include &lt;iostream&gt;<br>#include &lt;cstdlib&gt; // for rand() and srand()<br>#include &lt;ctime&gt; // for time()<br>#include &lt;algorithm&gt; // for std::sort()<br>using namespace std;<br><br>// 氣泡排序法函數<br>void bubbleSort(int arr[], int n) {<br>&nbsp; &nbsp; for (int i = 0; i &lt; n - 1; i++) {<br>&nbsp; &nbsp; &nbsp; &nbsp; for (int j = 0; j &lt; n - i - 1; j++) {<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if (arr[j] &gt; arr[j + 1]) {<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; // 如果相鄰的元素順序錯誤，則交換它們的位置<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; int temp = arr[j];<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; arr[j] = arr[j + 1];<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; arr[j + 1] = temp;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br>&nbsp; &nbsp; &nbsp; &nbsp; }<br>&nbsp; &nbsp; }<br>}<br><br>int main() {<br>&nbsp; &nbsp; const int SIZE = 6;<br>&nbsp; &nbsp; int arr[SIZE];<br><br>&nbsp; &nbsp; srand(time(nullptr));<br><br>&nbsp; &nbsp; // 生成1~49的數列<br>&nbsp; &nbsp; int nums[49];<br>&nbsp; &nbsp; for (int i = 0; i &lt; 49; i++) {<br>&nbsp; &nbsp; &nbsp; &nbsp; nums[i] = i + 1;<br>&nbsp; &nbsp; }<br><br>&nbsp; &nbsp; // 隨機選取6個不重複的數字(藉打亂數列，再取數列中前六個數字來達成)<br>&nbsp; &nbsp; random_shuffle(nums, nums + 49);<br>&nbsp; &nbsp; for (int i = 0; i &lt; SIZE; i++) {<br>&nbsp; &nbsp; &nbsp; &nbsp; arr[i] = nums[i];<br>&nbsp; &nbsp; }<br><br>&nbsp; &nbsp; // 輸出排序前的數組<br>&nbsp; &nbsp; cout &lt;&lt; "排序前的數組：";<br>&nbsp; &nbsp; for (int i = 0; i &lt; SIZE; i++) {<br>&nbsp; &nbsp; &nbsp; &nbsp; cout &lt;&lt; arr[i] &lt;&lt; " ";<br>&nbsp; &nbsp; }<br>&nbsp; &nbsp; cout &lt;&lt; endl;<br><br>&nbsp; &nbsp; // 使用氣泡排序法對數組進行排序<br>&nbsp; &nbsp; bubbleSort(arr, SIZE);<br><br>&nbsp; &nbsp; // 輸出排序後的數組<br>&nbsp; &nbsp; cout &lt;&lt; "排序後的數組：";<br>&nbsp; &nbsp; for (int i = 0; i &lt; SIZE; i++) {<br>&nbsp; &nbsp; &nbsp; &nbsp; cout &lt;&lt; arr[i] &lt;&lt; " ";<br>&nbsp; &nbsp; }<br>&nbsp; &nbsp; cout &lt;&lt; endl;<br><br>&nbsp; &nbsp; return 0;<br>}<br><br></div>]]></description>
         <enclosure url="" />
         <pubDate>2023-06-02 05:37:47 UTC</pubDate>
         <guid>https://padlet.com/s11030064/veue7isof4f3topc/wish/2612607087</guid>
      </item>
      <item>
         <title>程式碼</title>
         <author>s11030064</author>
         <link>https://padlet.com/s11030064/veue7isof4f3topc/wish/2612607835</link>
         <description><![CDATA[<div>/**********************<br>*&nbsp; 高二進階程式設計 &nbsp; *<br>* &nbsp; 大樂透程式開發&nbsp; *<br>* &nbsp; 206-19-宋承曄&nbsp; &nbsp; *<br>*&nbsp; &lt;產生N期中獎號碼&gt; *<br>**********************/<br>#include &lt;iostream&gt;<br>#include &lt;cstdlib&gt; // for rand() and srand()<br>#include &lt;ctime&gt; // for time()<br>#include &lt;algorithm&gt; // for std::sort()<br>using namespace std;<br><br>// 氣泡排序法函數<br>void bubbleSort(int arr[], int n) {<br>&nbsp; &nbsp; for (int i = 0; i &lt; n - 1; i++) {<br>&nbsp; &nbsp; &nbsp; &nbsp; for (int j = 0; j &lt; n - i - 1; j++) {<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if (arr[j] &gt; arr[j + 1]) {<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; // 如果相鄰的元素順序錯誤，則交換它們的位置<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; int temp = arr[j];<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; arr[j] = arr[j + 1];<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; arr[j + 1] = temp;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br>&nbsp; &nbsp; &nbsp; &nbsp; }<br>&nbsp; &nbsp; }<br>}<br><br>int main() {<br>&nbsp; &nbsp; const int SIZE = 6;<br>&nbsp; &nbsp; int arr[SIZE];<br><br>&nbsp; &nbsp; srand(time(nullptr));<br><br>&nbsp; &nbsp; // 詢問需要抽出幾期的大樂透號碼<br>&nbsp; &nbsp; int n; //抽出輪數<br>&nbsp; &nbsp; cout &lt;&lt; "請輸入需要抽出幾期的大樂透號碼：";<br>&nbsp; &nbsp; cin &gt;&gt; n;<br><br>&nbsp; &nbsp; // 隨機抽出n組號碼<br>&nbsp; &nbsp; for (int round = 1; round &lt;= n; round++) {<br>&nbsp; &nbsp; &nbsp; &nbsp; // 生成1~49的數列<br>&nbsp; &nbsp; &nbsp; &nbsp; int nums[49];<br>&nbsp; &nbsp; &nbsp; &nbsp; for (int i = 0; i &lt; 49; i++) {<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; nums[i] = i + 1;<br>&nbsp; &nbsp; &nbsp; &nbsp; }<br><br>&nbsp; &nbsp; &nbsp; &nbsp; // 隨機選取6個不重複的數字(藉打亂數列，再取數列中前六個數字來達成)<br>&nbsp; &nbsp; &nbsp; &nbsp; random_shuffle(nums, nums + 49);<br>&nbsp; &nbsp; &nbsp; &nbsp; for (int i = 0; i &lt; SIZE; i++) {<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; arr[i] = nums[i];<br>&nbsp; &nbsp; &nbsp; &nbsp; }<br><br>&nbsp; &nbsp; &nbsp; &nbsp; // 使用氣泡排序法對數組進行排序<br>&nbsp; &nbsp; &nbsp; &nbsp; bubbleSort(arr, SIZE);<br><br>&nbsp; &nbsp; &nbsp; &nbsp; // 輸出排序後的數組<br>&nbsp; &nbsp; &nbsp; &nbsp; cout &lt;&lt; "第" &lt;&lt; round &lt;&lt; "期大樂透號碼：";<br>&nbsp; &nbsp; &nbsp; &nbsp; for (int i = 0; i &lt; SIZE; i++) {<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; cout &lt;&lt; arr[i] &lt;&lt; " ";<br>&nbsp; &nbsp; &nbsp; &nbsp; }<br>&nbsp; &nbsp; &nbsp; &nbsp; cout &lt;&lt; endl;<br>&nbsp; &nbsp; }<br><br>&nbsp; &nbsp; return 0;<br>}<br><br></div>]]></description>
         <enclosure url="" />
         <pubDate>2023-06-02 05:38:50 UTC</pubDate>
         <guid>https://padlet.com/s11030064/veue7isof4f3topc/wish/2612607835</guid>
      </item>
      <item>
         <title>程式碼</title>
         <author>s11030064</author>
         <link>https://padlet.com/s11030064/veue7isof4f3topc/wish/2612608666</link>
         <description><![CDATA[<div>/**********************<br>*&nbsp; 高二進階程式設計 &nbsp; *<br>* &nbsp; 大樂透程式開發&nbsp; *<br>* &nbsp; 206-19-宋承曄&nbsp; &nbsp; *<br>*&nbsp; &nbsp; &lt; 查詢期別&nbsp; &gt;&nbsp; &nbsp; *<br>**********************/<br>#include &lt;iostream&gt;<br>#include &lt;cstdlib&gt; // for rand() and srand()<br>#include &lt;ctime&gt; // for time()<br>#include &lt;algorithm&gt; // for std::sort()<br>using namespace std;<br><br>// 氣泡排序法函數<br>void bubbleSort(int arr[], int n) {<br>&nbsp; &nbsp; for (int i = 0; i &lt; n - 1; i++) {<br>&nbsp; &nbsp; &nbsp; &nbsp; for (int j = 0; j &lt; n - i - 1; j++) {<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if (arr[j] &gt; arr[j + 1]) {<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; // 如果相鄰的元素順序錯誤，則交換它們的位置<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; int temp = arr[j];<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; arr[j] = arr[j + 1];<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; arr[j + 1] = temp;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br>&nbsp; &nbsp; &nbsp; &nbsp; }<br>&nbsp; &nbsp; }<br>}<br><br>int main() {<br>&nbsp; &nbsp; const int SIZE = 7;<br>&nbsp; &nbsp; int lotteryNumbers[10][SIZE];<br><br>&nbsp; &nbsp; srand(time(nullptr));<br><br>&nbsp; &nbsp; // 產生10期大樂透號碼<br>&nbsp; &nbsp; for (int round = 0; round &lt; 10; round++) {<br>&nbsp; &nbsp; &nbsp; &nbsp; // 生成1~49的數列<br>&nbsp; &nbsp; &nbsp; &nbsp; int nums[49];<br>&nbsp; &nbsp; &nbsp; &nbsp; for (int i = 0; i &lt; 49; i++) {<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; nums[i] = i + 1;<br>&nbsp; &nbsp; &nbsp; &nbsp; }<br><br>&nbsp; &nbsp; &nbsp; &nbsp; // 隨機選取7個不重複的數字(藉打亂數列，再取數列中前七個數字來達成)<br>&nbsp; &nbsp; &nbsp; &nbsp; random_shuffle(nums, nums + 49);<br>&nbsp; &nbsp; &nbsp; &nbsp; for (int i = 0; i &lt; SIZE; i++) {<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; lotteryNumbers[round][i] = nums[i];<br>&nbsp; &nbsp; &nbsp; &nbsp; }<br><br>&nbsp; &nbsp; &nbsp; &nbsp; // 特別號為第一個數字<br>&nbsp; &nbsp; &nbsp; &nbsp; int specialNumber = lotteryNumbers[round][0];<br>&nbsp; &nbsp; &nbsp; &nbsp; // 不包括特別號的6個數字做排序<br>&nbsp; &nbsp; &nbsp; &nbsp; bubbleSort(&amp;lotteryNumbers[round][1], SIZE - 1);<br><br>&nbsp; &nbsp; &nbsp; &nbsp; // 輸出排序後的數組<br>&nbsp; &nbsp; &nbsp; &nbsp; cout &lt;&lt; "第" &lt;&lt; round + 1 &lt;&lt; "期中獎號碼：";<br>&nbsp; &nbsp; &nbsp; &nbsp; for (int i = 1; i &lt; SIZE; i++) {<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; cout &lt;&lt; lotteryNumbers[round][i] &lt;&lt; " ";<br>&nbsp; &nbsp; &nbsp; &nbsp; }<br>&nbsp; &nbsp; &nbsp; &nbsp; cout &lt;&lt; "/ 特別號：" &lt;&lt; specialNumber &lt;&lt; endl;<br>&nbsp; &nbsp; }<br><br>&nbsp; &nbsp; // 詢問需要查詢哪期大樂透號碼進行兌獎<br>&nbsp; &nbsp; int queryRound;<br>&nbsp; &nbsp; cout &lt;&lt; "請輸入需要查詢的大樂透期數：";<br>&nbsp; &nbsp; cin &gt;&gt; queryRound;<br><br>&nbsp; &nbsp; // 輸出該期中獎號碼<br>&nbsp; &nbsp; int specialNumber = lotteryNumbers[queryRound - 1][0];<br>&nbsp; &nbsp; bubbleSort(&amp;lotteryNumbers[queryRound - 1][1], SIZE - 1);<br>&nbsp; &nbsp; cout &lt;&lt; "第" &lt;&lt; queryRound &lt;&lt; "期中獎號碼：";<br>&nbsp; &nbsp; for (int i = 1; i &lt; SIZE; i++) {<br>&nbsp; &nbsp; &nbsp; &nbsp; cout &lt;&lt; lotteryNumbers[queryRound - 1][i] &lt;&lt; " ";<br>&nbsp; &nbsp; }<br>&nbsp; &nbsp; cout &lt;&lt; "/ 特別號：" &lt;&lt; specialNumber &lt;&lt; endl;<br><br>&nbsp; &nbsp; return 0;<br>}</div>]]></description>
         <enclosure url="" />
         <pubDate>2023-06-02 05:39:59 UTC</pubDate>
         <guid>https://padlet.com/s11030064/veue7isof4f3topc/wish/2612608666</guid>
      </item>
      <item>
         <title>程式碼</title>
         <author>s11030064</author>
         <link>https://padlet.com/s11030064/veue7isof4f3topc/wish/2612608942</link>
         <description><![CDATA[<div>/**********************<br>*&nbsp; 高二進階程式設計 &nbsp; *<br>* &nbsp; 大樂透程式開發&nbsp; *<br>* &nbsp; 206-19-宋承曄&nbsp; &nbsp; *<br>*&nbsp; &lt;產生N期中獎號碼&gt; *<br>**********************/<br>#include &lt;iostream&gt;<br>#include &lt;cstdlib&gt; // for rand() and srand()<br>#include &lt;ctime&gt; // for time()<br>#include &lt;algorithm&gt; // for std::sort()<br><br>using namespace std;<br><br>void bubbleSort(int arr[], int n) {<br>&nbsp; &nbsp; for (int i = 0; i &lt; n - 1; i++) {<br>&nbsp; &nbsp; &nbsp; &nbsp; for (int j = 0; j &lt; n - i - 1; j++) {<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if (arr[j] &gt; arr[j + 1]) {<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; int temp = arr[j];<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; arr[j] = arr[j + 1];<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; arr[j + 1] = temp;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br>&nbsp; &nbsp; &nbsp; &nbsp; }<br>&nbsp; &nbsp; }<br>}<br><br>int main() {<br>&nbsp; &nbsp; const int SIZE = 7;<br>&nbsp; &nbsp; const int NUM_ROUNDS = 10;<br>&nbsp; &nbsp; int lotteryNumbers[NUM_ROUNDS][SIZE];<br><br>&nbsp; &nbsp; srand(time(nullptr));<br><br>&nbsp; &nbsp; for (int round = 0; round &lt; NUM_ROUNDS; round++) {<br>&nbsp; &nbsp; &nbsp; &nbsp; int nums[49];<br>&nbsp; &nbsp; &nbsp; &nbsp; for (int i = 0; i &lt; 49; i++) {<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; nums[i] = i + 1;<br>&nbsp; &nbsp; &nbsp; &nbsp; }<br><br>&nbsp; &nbsp; &nbsp; &nbsp; random_shuffle(nums, nums + 49);<br>&nbsp; &nbsp; &nbsp; &nbsp; for (int i = 0; i &lt; SIZE; i++) {<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; lotteryNumbers[round][i] = nums[i];<br>&nbsp; &nbsp; &nbsp; &nbsp; }<br><br>&nbsp; &nbsp; &nbsp; &nbsp; int specialNumber = lotteryNumbers[round][0];<br>&nbsp; &nbsp; &nbsp; &nbsp; bubbleSort(&amp;lotteryNumbers[round][1], SIZE - 1);<br><br>&nbsp; &nbsp; &nbsp; &nbsp; cout &lt;&lt; "第" &lt;&lt; round + 1 &lt;&lt; "期中獎號碼：";<br>&nbsp; &nbsp; &nbsp; &nbsp; for (int i = 1; i &lt; SIZE; i++) {<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; cout &lt;&lt; lotteryNumbers[round][i] &lt;&lt; " ";<br>&nbsp; &nbsp; &nbsp; &nbsp; }<br>&nbsp; &nbsp; &nbsp; &nbsp; cout &lt;&lt; "/ 特別號：" &lt;&lt; specialNumber &lt;&lt; endl;<br>&nbsp; &nbsp; }<br><br>&nbsp; &nbsp; char continueOption = 'y';<br>&nbsp; &nbsp; while (continueOption == 'y' || continueOption == 'Y') {<br>&nbsp; &nbsp; &nbsp; &nbsp; int queryRound;<br>&nbsp; &nbsp; &nbsp; &nbsp; cout &lt;&lt; "請輸入需要查詢的大樂透期數：";<br>&nbsp; &nbsp; &nbsp; &nbsp; cin &gt;&gt; queryRound;<br><br>&nbsp; &nbsp; &nbsp; &nbsp; int userNumbers[SIZE];<br>&nbsp; &nbsp; &nbsp; &nbsp; cout &lt;&lt; "請輸入您在該期的大樂透號碼（共" &lt;&lt; SIZE &lt;&lt; "個號碼）：";<br>&nbsp; &nbsp; &nbsp; &nbsp; for (int i = 0; i &lt; SIZE; i++) {<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; cin &gt;&gt; userNumbers[i];<br>&nbsp; &nbsp; &nbsp; &nbsp; }<br><br>&nbsp; &nbsp; &nbsp; &nbsp; int specialNumber = lotteryNumbers[queryRound - 1][0];<br>&nbsp; &nbsp; &nbsp; &nbsp; bubbleSort(&amp;lotteryNumbers[queryRound - 1][1], SIZE - 1);<br><br>&nbsp; &nbsp; &nbsp; &nbsp; cout &lt;&lt; "第" &lt;&lt; queryRound &lt;&lt; "期中獎號碼：";<br>&nbsp; &nbsp; &nbsp; &nbsp; for (int i = 1; i &lt; SIZE; i++) {<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; cout &lt;&lt; lotteryNumbers[queryRound - 1][i] &lt;&lt; " ";<br>&nbsp; &nbsp; &nbsp; &nbsp; }<br>&nbsp; &nbsp; &nbsp; &nbsp; cout &lt;&lt; "/ 特別號：" &lt;&lt; specialNumber &lt;&lt; endl;<br><br>&nbsp; &nbsp; &nbsp; &nbsp; // Check if user's numbers match<br>&nbsp; &nbsp; &nbsp; &nbsp; bool isWinning = true;<br>&nbsp; &nbsp; &nbsp; &nbsp; for (int i = 0; i &lt; SIZE; i++) {<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if (find(userNumbers, userNumbers + SIZE, lotteryNumbers[queryRound - 1][i]) == userNumbers + SIZE) {<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; isWinning = false;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; break;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br>&nbsp; &nbsp; &nbsp; &nbsp; }<br><br>&nbsp; &nbsp; &nbsp; &nbsp; if (isWinning) {<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; cout &lt;&lt; "[第" &lt;&lt; queryRound &lt;&lt; "期]：中獎！" &lt;&lt; endl;<br>&nbsp; &nbsp; &nbsp; &nbsp; } else {<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; cout &lt;&lt; "[第" &lt;&lt; queryRound &lt;&lt; "期]：沒中獎" &lt;&lt; endl;<br>&nbsp; &nbsp; &nbsp; &nbsp; }<br><br>&nbsp; &nbsp; &nbsp; &nbsp; cout &lt;&lt; "是否繼續？（輸入 y 或 Y 繼續，其他任意鍵(不含空白及Enter鍵)退出）：";<br>&nbsp; &nbsp; &nbsp; &nbsp; cin &gt;&gt; continueOption;<br>&nbsp; &nbsp; }<br><br>&nbsp; &nbsp; return 0;<br>}</div>]]></description>
         <enclosure url="" />
         <pubDate>2023-06-02 05:40:18 UTC</pubDate>
         <guid>https://padlet.com/s11030064/veue7isof4f3topc/wish/2612608942</guid>
      </item>
   </channel>
</rss>
