<?xml version="1.0"?>
<rss version="2.0">
   <channel>
      <title>大樂透程式開發流程 by 20501白鈺皞</title>
      <link>https://padlet.com/s11035065/8m2tuxpg201uupo2</link>
      <description>111(2) 高二C班課程</description>
      <language>en-us</language>
      <pubDate>2023-03-30 01:27:17 UTC</pubDate>
      <lastBuildDate>2023-06-15 01:38:39 UTC</lastBuildDate>
      <webMaster>hello@padlet.com</webMaster>
      <image>
         <url>https://padlet.net/icons/png/1f4ae.png</url>
      </image>
      <item>
         <title>抽籤/取亂數 </title>
         <author>s11035065</author>
         <link>https://padlet.com/s11035065/8m2tuxpg201uupo2/wish/2537564720</link>
         <description><![CDATA[<div><br>#include &lt;iostream&gt;<br>#include &lt;cstdlib&gt;<br>#include &lt;ctime&gt;<br><br>using namespace std;<br><br>int main() {<br>&nbsp; &nbsp; srand(time(NULL));&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<mark>//亂數</mark><br>&nbsp; &nbsp; int evens[6];&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;//建立大小為六的陣列<br>&nbsp; &nbsp; int count=0;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;//計算偶數個數<br>&nbsp; &nbsp;&nbsp;<br>&nbsp; &nbsp; while(count&lt;6){<br>&nbsp; &nbsp; &nbsp; &nbsp; int num =rand()%100+1;&nbsp; &nbsp;<br>&nbsp; &nbsp; &nbsp; &nbsp; //產生1-100的亂數<br>&nbsp; &nbsp; &nbsp; &nbsp; if(num%2==0){&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;//判斷是否為偶數<br>&nbsp; &nbsp; &nbsp; &nbsp; evens[count]=num;&nbsp; &nbsp; &nbsp; //存入陣列<br>&nbsp; &nbsp; &nbsp; &nbsp; count++;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; //偶數個數+1<br>&nbsp; &nbsp; &nbsp; &nbsp; }<br>&nbsp; &nbsp; }<br>&nbsp; &nbsp;&nbsp;<br>&nbsp; &nbsp; cout&lt;&lt;endl;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;//印出陣列<br>&nbsp; &nbsp; for(int i =0; i&lt;6; i++){<br>&nbsp; &nbsp; &nbsp; &nbsp; cout&lt;&lt;evens[i]&lt;&lt;" ";<br>&nbsp; &nbsp; }<br>&nbsp; &nbsp;&nbsp;<br><br>&nbsp; &nbsp; return 0;<br>}<br><br><br></div>]]></description>
         <enclosure url="https://onlinegdb.com/vvs-YFY-8" />
         <pubDate>2023-03-30 01:31:28 UTC</pubDate>
         <guid>https://padlet.com/s11035065/8m2tuxpg201uupo2/wish/2537564720</guid>
      </item>
      <item>
         <title>六個數字的排序</title>
         <author>s11035065</author>
         <link>https://padlet.com/s11035065/8m2tuxpg201uupo2/wish/2537569837</link>
         <description><![CDATA[<div><br>#include &lt;iostream&gt;<br>#include &lt;cstdlib&gt;<br>#include &lt;ctime&gt;<br><br>using namespace std;<br><br>int main() {<br>&nbsp; &nbsp; srand(time(NULL));&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;//亂數<br>&nbsp; &nbsp; int evens[6];&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;//建立大小為六的陣列<br>&nbsp; &nbsp; int count=0;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;//計算偶數個數<br>&nbsp; &nbsp; <br>&nbsp; &nbsp; while(count&lt;6){<br>&nbsp; &nbsp; &nbsp; &nbsp; int num =rand()%49+1;&nbsp; &nbsp; //產生1-49的亂數<br>&nbsp; &nbsp; &nbsp; &nbsp; if(num%2==0){&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;//判斷是否為偶數<br>&nbsp; &nbsp; &nbsp; &nbsp; evens[count]=num;&nbsp; &nbsp; &nbsp; //存入陣列<br>&nbsp; &nbsp; &nbsp; &nbsp; count++;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; //偶數個數+1<br>&nbsp; &nbsp; &nbsp; &nbsp; }<br>&nbsp; &nbsp; }<br>&nbsp; &nbsp; <br>&nbsp; &nbsp; cout&lt;&lt;"排序前:"&lt;&lt;endl;&nbsp; &nbsp; &nbsp;//印出排序前的陣列<br>&nbsp; &nbsp; for(int i =0; i&lt;6; i++){<br>&nbsp; &nbsp; &nbsp; &nbsp; cout&lt;&lt;evens[i]&lt;&lt;" ";<br>&nbsp; &nbsp; }<br>&nbsp; &nbsp; <br>&nbsp; &nbsp; for (int i=0; i&lt;6; i++){&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<mark>//氣泡排序法</mark><br>&nbsp; &nbsp; &nbsp; &nbsp; for (int j=0; j&lt;5-i; j++){<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if(evens[j]&gt;evens[j+1]){<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; int temp=evens[j];<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; evens[j]=evens[j+1];<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; evens[j+1]=temp;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br>&nbsp; &nbsp; &nbsp; &nbsp; }<br>&nbsp; &nbsp; }<br><br>&nbsp; &nbsp; cout&lt;&lt;endl&lt;&lt;"排序後:"&lt;&lt;endl;&nbsp; &nbsp; &nbsp; &nbsp;//印出排序後的陣列<br>&nbsp; &nbsp; for(int i =0; i&lt;6; i++){<br>&nbsp; &nbsp; &nbsp; &nbsp; cout&lt;&lt; evens[i]&lt;&lt;" ";<br>&nbsp; &nbsp;&nbsp;<br>&nbsp; &nbsp; }<br>&nbsp; &nbsp; cout&lt;&lt;endl;<br><br><br>&nbsp; &nbsp; return 0;<br>}<br><br></div>]]></description>
         <enclosure url="https://onlinegdb.com/mFMIEInvR" />
         <pubDate>2023-03-30 01:35:13 UTC</pubDate>
         <guid>https://padlet.com/s11035065/8m2tuxpg201uupo2/wish/2537569837</guid>
      </item>
      <item>
         <title>號碼不重覆 </title>
         <author>s11035065</author>
         <link>https://padlet.com/s11035065/8m2tuxpg201uupo2/wish/2537573955</link>
         <description><![CDATA[<div><br>#include &lt;iostream&gt;<br>#include &lt;cstdlib&gt;<br>#include &lt;ctime&gt;<br><br>using namespace std;<br><br>int main() {<br>&nbsp; &nbsp; srand(time(NULL));&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;//亂數<br>&nbsp; &nbsp; int evens[6];&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;//建立大小為六的陣列<br>&nbsp;<br>&nbsp; &nbsp; <br>&nbsp; &nbsp; for(int i=0;i&lt;6;i++){<br>&nbsp; &nbsp; &nbsp; &nbsp; evens[i] =rand()%49+1;&nbsp; &nbsp; //產生1-49的亂數<br>&nbsp; &nbsp; <br>&nbsp; &nbsp; &nbsp; &nbsp; for(int j=0;j&lt;i;j++){&nbsp; &nbsp; &nbsp;<mark>//若數字重複則重新取</mark><br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if(evens[i]==evens[j]){<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; i--;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; break;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br>&nbsp; &nbsp; &nbsp; &nbsp; }<br>&nbsp; &nbsp; }<br>&nbsp; &nbsp;&nbsp;<br>&nbsp; &nbsp; cout&lt;&lt;"排序前:"&lt;&lt;endl;&nbsp; &nbsp; &nbsp;//印出排序前的陣列<br>&nbsp; &nbsp; for(int i =0; i&lt;6; i++){<br>&nbsp; &nbsp; &nbsp; &nbsp; cout&lt;&lt;evens[i]&lt;&lt;" ";<br>&nbsp; &nbsp; }<br>&nbsp; &nbsp;&nbsp;<br>&nbsp; &nbsp; for (int i=0; i&lt;6; i++){&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;//氣泡排序法<br>&nbsp; &nbsp; &nbsp; &nbsp; for (int j=0; j&lt;5-i; j++){<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if(evens[j]&gt;evens[j+1]){<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; int temp=evens[j];<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; evens[j]=evens[j+1];<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; evens[j+1]=temp;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br>&nbsp; &nbsp; &nbsp; &nbsp; }<br>&nbsp; &nbsp; }<br><br>&nbsp; &nbsp; cout&lt;&lt;endl&lt;&lt;"排序後:"&lt;&lt;endl;&nbsp; &nbsp; &nbsp; &nbsp;//印出排序後的陣列<br>&nbsp; &nbsp; for(int i =0; i&lt;6; i++){<br>&nbsp; &nbsp; &nbsp; &nbsp; cout&lt;&lt; evens[i]&lt;&lt;" ";<br>&nbsp; &nbsp;&nbsp;<br>&nbsp; &nbsp; }<br>&nbsp; &nbsp; cout&lt;&lt;endl;<br><br><br>&nbsp; &nbsp; return 0;<br>}<br><br></div>]]></description>
         <enclosure url="https://onlinegdb.com/owQ4qFzuE" />
         <pubDate>2023-03-30 01:38:10 UTC</pubDate>
         <guid>https://padlet.com/s11035065/8m2tuxpg201uupo2/wish/2537573955</guid>
      </item>
      <item>
         <title>產生N期中獎號碼</title>
         <author>s11035065</author>
         <link>https://padlet.com/s11035065/8m2tuxpg201uupo2/wish/2537575282</link>
         <description><![CDATA[<div><br>#include &lt;iostream&gt;<br>#include &lt;cstdlib&gt;<br>#include &lt;ctime&gt;<br><br>using namespace std;<br><br>int main() {<br>&nbsp; &nbsp; srand(time(NULL));&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;//亂數<br>&nbsp; &nbsp;<br>&nbsp; &nbsp; int n;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<mark>//抽出期數</mark><br>&nbsp; &nbsp; cout&lt;&lt;"需要抽出幾期?";<br>&nbsp; &nbsp; cin&gt;&gt;n;<br>&nbsp; &nbsp;&nbsp;<br>&nbsp; &nbsp; for(int k=1; k&lt;=n; k++){<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;int evens[6];&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;//建立大小為六的陣列<br>&nbsp; &nbsp;<br>&nbsp; &nbsp;&nbsp;<br>&nbsp; &nbsp; for(int i=0;i&lt;6;i++){<br>&nbsp; &nbsp; &nbsp; &nbsp; evens[i] =rand()%49+1;&nbsp; &nbsp; //產生1-49的亂數<br>&nbsp; &nbsp;&nbsp;<br>&nbsp; &nbsp; &nbsp; &nbsp; for(int j=0;j&lt;i;j++){&nbsp; &nbsp; &nbsp;//若數字重複則重新取<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if(evens[i]==evens[j]){<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; i--;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; break;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br>&nbsp; &nbsp; &nbsp; &nbsp; }<br>&nbsp; &nbsp; }<br>&nbsp; &nbsp;&nbsp;<br><br>&nbsp; &nbsp; for (int i=0; i&lt;6; i++){&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;//氣泡排序法<br>&nbsp; &nbsp; &nbsp; &nbsp; for (int j=0; j&lt;5-i; j++){<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if(evens[j]&gt;evens[j+1]){<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; int temp=evens[j];<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; evens[j]=evens[j+1];<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; evens[j+1]=temp;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br>&nbsp; &nbsp; &nbsp; &nbsp; }<br>&nbsp; &nbsp; }<br><br>&nbsp; &nbsp; cout&lt;&lt;endl&lt;&lt;"第"&lt;&lt;k&lt;&lt;"期"&lt;&lt;endl;&nbsp; &nbsp; &nbsp; &nbsp;//印出排序後的陣列<br>&nbsp; &nbsp; for(int i =0; i&lt;6; i++){<br>&nbsp; &nbsp; &nbsp; &nbsp; cout&lt;&lt; evens[i]&lt;&lt;" ";<br>&nbsp; &nbsp;&nbsp;<br>&nbsp; &nbsp; &nbsp; &nbsp; }<br>&nbsp; &nbsp; }<br>&nbsp; &nbsp; cout&lt;&lt;endl;<br><br><br><br><br><br>&nbsp; &nbsp; return 0;<br>}<br><br></div>]]></description>
         <enclosure url="https://onlinegdb.com/MIg14IldDS" />
         <pubDate>2023-03-30 01:39:09 UTC</pubDate>
         <guid>https://padlet.com/s11035065/8m2tuxpg201uupo2/wish/2537575282</guid>
      </item>
      <item>
         <title>加上特別號/ 查詢期別 </title>
         <author>s11035065</author>
         <link>https://padlet.com/s11035065/8m2tuxpg201uupo2/wish/2569561624</link>
         <description><![CDATA[<div>#include &lt;iostream&gt;<br>#include &lt;cstdlib&gt;<br>#include &lt;ctime&gt;<br><br>using namespace std;<br><br>int main() {<br>&nbsp; &nbsp; srand(time(NULL));&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; //亂數<br>&nbsp; &nbsp;<br>&nbsp; &nbsp; const int n=10;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; //期數訂為10<br>&nbsp; &nbsp; int nums[n][7];&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<mark>//二維數組存儲10期號碼，包括特別號</mark><br>&nbsp; &nbsp;<br><br>&nbsp; &nbsp; for(int k=0; k&lt;n; k++){<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;int evens[6];&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;//建立大小為六的陣列<br>&nbsp; &nbsp;<br>&nbsp; &nbsp; <br>&nbsp; &nbsp; &nbsp; &nbsp; for(int i=0;i&lt;6;i++){<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; evens[i] =rand()%49+1;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;//產生1-49的亂數<br>&nbsp; &nbsp; <br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; for(int j=0;j&lt;i;j++){&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;//若數字重複則重新取<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if(evens[i]==evens[j]){<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; i--;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; break;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br>&nbsp; &nbsp; &nbsp; &nbsp; }<br>&nbsp; &nbsp; <br>&nbsp; &nbsp; &nbsp; &nbsp; nums[k][0] = k + 1;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;// 將期數存入數組<br>&nbsp; &nbsp; &nbsp; &nbsp; <br>&nbsp; &nbsp; &nbsp; &nbsp; for (int i=0; i&lt;6; i++){&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;//氣泡排序法<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; for (int j=0; j&lt;5-i; j++){<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if(evens[j]&gt;evens[j+1]){<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; int temp=evens[j];<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; evens[j]=evens[j+1];<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; evens[j+1]=temp;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br>&nbsp; &nbsp; &nbsp; &nbsp; }<br>&nbsp; &nbsp; &nbsp; &nbsp; <br>&nbsp; &nbsp; &nbsp; &nbsp; <br>&nbsp; &nbsp; &nbsp; &nbsp; for (int i=0; i&lt;6; i++){&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; //將排序後的6個號碼和特別號存入數組<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; nums[k][i+1] = evens[i];&nbsp; <br>&nbsp; &nbsp; &nbsp; &nbsp; }<br>&nbsp; &nbsp; &nbsp; &nbsp; nums[k][6] = rand()%49+1;&nbsp; &nbsp; &nbsp; &nbsp; <mark>// 生成特別號</mark><br>&nbsp; &nbsp; }<br>&nbsp; &nbsp; <br>&nbsp; &nbsp; <br>&nbsp; &nbsp; for(int k=0; k&lt;n; k++){&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;//輸出10期號碼，包括特別號<br>&nbsp; &nbsp; &nbsp; &nbsp; cout &lt;&lt; "第" &lt;&lt; nums[k][0] &lt;&lt; "期中獎號碼: "&lt;&lt;endl;<br>&nbsp; &nbsp; &nbsp; &nbsp; for(int i=0;i&lt;6;i++){<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; cout&lt;&lt;nums[k][i+1]&lt;&lt;" ";<br>&nbsp; &nbsp; &nbsp; &nbsp; }<br>&nbsp; &nbsp; &nbsp; &nbsp; cout&lt;&lt;endl &lt;&lt; "特別號：" &lt;&lt; nums[k][6] &lt;&lt; endl;<br>&nbsp; &nbsp; }<br>&nbsp; &nbsp; <br>&nbsp; &nbsp; <br>&nbsp; &nbsp; int p;<br>&nbsp; &nbsp; cout&lt;&lt;"想要對獎的期別?";&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <mark>//查詢期別的號碼</mark><br>&nbsp; &nbsp; cin&gt;&gt;p;<br>&nbsp; &nbsp; if(p &gt;=1 &amp;&amp; p&lt;=10){<br>&nbsp; &nbsp; &nbsp; &nbsp; cout&lt;&lt;"第"&lt;&lt;p&lt;&lt;"期中獎號碼: ";<br>&nbsp; &nbsp; &nbsp; &nbsp; for(int i =1; i&lt;=6;i++){<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; cout&lt;&lt;nums[p-1][i]&lt;&lt;" ";<br>&nbsp; &nbsp; &nbsp; &nbsp; } &nbsp;<br>&nbsp; &nbsp; &nbsp; &nbsp; cout &lt;&lt; "特別號：" &lt;&lt; nums[p-1][6] &lt;&lt; endl;<br>&nbsp; &nbsp; }<br>&nbsp; &nbsp; else{<br>&nbsp; &nbsp; &nbsp; &nbsp; cout&lt;&lt;"無該期之中獎號碼"&lt;&lt;endl; &nbsp;<br>&nbsp; &nbsp; }<br><br>&nbsp; &nbsp; return 0;<br>}<br><br></div>]]></description>
         <enclosure url="https://onlinegdb.com/KNUsYnNfV" />
         <pubDate>2023-04-27 01:16:59 UTC</pubDate>
         <guid>https://padlet.com/s11035065/8m2tuxpg201uupo2/wish/2569561624</guid>
      </item>
      <item>
         <title> 單一期別/號碼的對獎 </title>
         <author>s11035065</author>
         <link>https://padlet.com/s11035065/8m2tuxpg201uupo2/wish/2569571962</link>
         <description><![CDATA[<div>#include &lt;iostream&gt;<br>#include &lt;cstdlib&gt;<br>#include &lt;ctime&gt;<br><br>using namespace std;<br><br>int main() {<br>&nbsp; &nbsp; srand(time(NULL)); // 亂數種子<br><br>&nbsp; &nbsp; const int n = 10; // 期數設為10<br>&nbsp; &nbsp; int nums[n][7]; // 二維數組存儲10期號碼，包括特別號<br><br>&nbsp; &nbsp; for (int k = 0; k &lt; n; k++) {<br>&nbsp; &nbsp; &nbsp; &nbsp; int evens[6]; // 建立大小為六的陣列<br><br>&nbsp; &nbsp; &nbsp; &nbsp; for (int i = 0; i &lt; 6; i++) {<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; evens[i] = rand() % 49 + 1; // 產生1-49的亂數<br><br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; for (int j = 0; j &lt; i; j++) { // 若數字重複則重新取<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if (evens[i] == evens[j]) {<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; i--;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; break;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br>&nbsp; &nbsp; &nbsp; &nbsp; }<br><br>&nbsp; &nbsp; &nbsp; &nbsp; nums[k][0] = k + 1; // 將期數存入數組<br><br>&nbsp; &nbsp; &nbsp; &nbsp; for (int i = 0; i &lt; 6; i++) { // 氣泡排序法<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; for (int j = 0; j &lt; 5 - i; j++) {<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if (evens[j] &gt; evens[j + 1]) {<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; int temp = evens[j];<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; evens[j] = evens[j + 1];<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; evens[j + 1] = temp;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br>&nbsp; &nbsp; &nbsp; &nbsp; }<br><br>&nbsp; &nbsp; &nbsp; &nbsp; for (int i = 0; i &lt; 6; i++) { // 將排序後的6個號碼和特別號存入數組<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; nums[k][i + 1] = evens[i];<br>&nbsp; &nbsp; &nbsp; &nbsp; }<br>&nbsp; &nbsp; &nbsp; &nbsp; nums[k][6] = rand() % 49 + 1; // 生成特別號<br>&nbsp; &nbsp; }<br><br>&nbsp; &nbsp; for (int k = 0; k &lt; n; k++) { // 輸出10期號碼，包括特別號<br>&nbsp; &nbsp; &nbsp; &nbsp; cout &lt;&lt; "第" &lt;&lt; nums[k][0] &lt;&lt; "期中獎號碼: " &lt;&lt; endl;<br>&nbsp; &nbsp; &nbsp; &nbsp; for (int i = 0; i &lt; 6; i++) {<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; cout &lt;&lt; nums[k][i + 1] &lt;&lt; " ";<br>&nbsp; &nbsp; &nbsp; &nbsp; }<br>&nbsp; &nbsp; &nbsp; &nbsp; cout &lt;&lt; endl<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;&lt; "特別號：" &lt;&lt; nums[k][6] &lt;&lt; endl;<br>&nbsp; &nbsp; }<br><br>&nbsp; &nbsp; string continueQuery = "Y";<br><br>&nbsp; &nbsp; while (continueQuery == "Y") {<br>&nbsp; &nbsp; &nbsp; &nbsp; int queryPeriod;<br>&nbsp; &nbsp; &nbsp; &nbsp; cout &lt;&lt; "要查詢的期別是第幾期?" &lt;&lt; endl;<br>&nbsp; &nbsp; &nbsp; &nbsp; cin &gt;&gt; queryPeriod;<br><br>&nbsp; &nbsp; &nbsp; &nbsp; if (queryPeriod &gt;= 1 &amp;&amp; queryPeriod &lt;= n) {<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; int queryNumber;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; cout &lt;&lt; "要查詢哪個號碼?" &lt;&lt; endl;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; cin &gt;&gt; queryNumber;<br><br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; bool found = false;<br><br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; for (int i = 0; i &lt; 7; i++) {<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if (queryNumber == nums[queryPeriod - 1][i]) { &nbsp;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;found = true;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br><br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if (found) {<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; cout &lt;&lt; "第" &lt;&lt; queryPeriod &lt;&lt; "期中獎！" &lt;&lt; endl;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; } else {<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; cout &lt;&lt; "第" &lt;&lt; queryPeriod &lt;&lt; "期沒中獎。" &lt;&lt; endl;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br>&nbsp; &nbsp; &nbsp; &nbsp; } else {<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; cout &lt;&lt; "無效的期別。" &lt;&lt; endl;<br>&nbsp; &nbsp; &nbsp; &nbsp; }<br><br>&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;<br>&nbsp; &nbsp; cout &lt;&lt; "是否要繼續查詢？(Y/N)" &lt;&lt; endl;<br>&nbsp; &nbsp; &nbsp; &nbsp; cin &gt;&gt; continueQuery;<br>&nbsp; &nbsp; }<br><br>&nbsp; &nbsp; cout &lt;&lt; "結束。" &lt;&lt; endl;<br><br>&nbsp; &nbsp; return 0;<br>}<br><br><br><br><br>onlinegdb.com<br><br>NxEzzHPL6<br><br>目前</div>]]></description>
         <enclosure url="https://onlinegdb.com/NxEzzHPL6" />
         <pubDate>2023-04-27 01:24:07 UTC</pubDate>
         <guid>https://padlet.com/s11035065/8m2tuxpg201uupo2/wish/2569571962</guid>
      </item>
   </channel>
</rss>
