<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                ??碼云GVP開源項目 12k star Uniapp+ElementUI 功能強大 支持多語言、二開方便! 廣告
                # 【程序設計】一大波好玩兒的程序 結合暫停命令Sleep和清屏幕命令system("cls"),讓字母H從屏幕的左邊往右邊跑。 * 命令`Sleep(x)`,x為毫秒值,引入window.h * 命令 `system("cls)` 清除屏幕輸出內容 * 命令 `system("color xy")` ,color為關鍵字,x為背景色,y為前景色,x,y可以取值為。 * 0\=黑色 * 1\=藍色 * 2\=綠色 * 3\=湖藍色 * 4\=紅色 * 5\=紫色 * 6\=黃色 * 7\=白色 * 8\=灰色 * 9\=淡藍色 * A\=淡綠色 * B\=淡淺綠色 * C\=淡紅色 * D\=淡紫色 * E\=淡黃色 * F\=亮白色 ***** 哥德巴赫猜想:“任一大于2的整數都可以寫成3個質數之和”。此猜想可以有另一個等價版本,即“任一大于2的偶數都可以寫成兩個質數之和”。 ``` #include<bits/stdc++.h> using namespace std; int main(){ int a,b,count1,count2,count3; for(int k=4;k<=10000;k+=2){ count3=0; for(a=2;a<=k/2;a++){ // 判斷a是否為質數 count1=0; for(int i=2;i<=a-1;i++){ if(a%i==0){ count1++; break; } } if(count1==0){ // 如果a為質數 b=k-a; // 判斷b是否為質數 count2=0; for(int i=2;i<=b-1;i++){ if(b%i==0){ count2++; break; } } if(count2==0){ printf("%d=%d+%d\n",k,a,b); count3++; break; } } } if(count3==0) { printf("%d數有問題",k); } } return 0; } ``` ***** 請在 `_3 x 6528 = 3_ x 8256` 填上合適的值。 ``` #include<bits/stdc++.h> using namespace std; int main(){ for(int i=1;i<=9;i++){ if((i*10+3)*6528==(30+i)*8256){ printf("%d",i); } } } ``` ***** ABCD x E = DCBA ,在上面的算式中,ABCDE分別代表5個互不相的值,請問ABCDE分別為多少時算式才會成立,并輸出算式值。 ``` #include<bits/stdc++.h> using namespace std; int main(){ for(int a=1;a<=9;a++){ for(int b=0;b<=9;b++){ for(int c=0;c<=9;c++){ for(int d=1;d<=9;d++){ for(int e=1;e<=9;e++){ if(a!=b&&a!=c&&a!=d&&a!=e &&b!=c&&b!=d&&b!=e &&c!=d&&c!=e &&d!=e){ if((a*1000+b*100+c*10+d)*e==d*1000+c*100+b*10+a){ printf("%d%d%d%d\n",a,b,c,d); printf("x %d\n",e); printf("----\n",a,b,c,d); printf("%d%d%d%d\n",d,c,b,a); } } } } } } } } ``` ***** 用1-6這6個自然數組成一個三角形·,并讓這個三角形三條邊上的數字之和相等,請輸出所有的可能性。 ``` #include<bits/stdc++.h> using namespace std; int main(){ int count=0; for(int a=1;a<=6;a++){ for(int b=1;b<=6;b++){ for(int c=1;c<=6;c++){ for(int d=1;d<=6;d++){ for(int e=1;e<=6;e++){ for(int f=1;f<=6;f++){ if(a!=b&&a!=c&&a!=d&&a!=e&&a!=f &&b!=c&&b!=d&&b!=e&&b!=f &&c!=d&&c!=e&&c!=f &&d!=e&&d!=f &&e!=f){ if(a+b+c==c+d+e&&c+d+e==e+f+a){ printf(" %d\n",a); printf(" %d %d\n",b,f); printf("%d %d %d\n",c,d,e); count++; } } } } } } } } printf("一共%d種組合",count); } ``` ***** 計算機會隨機地給出一個0-99的整數,你能猜出這個數嗎?每猜一次,計算機都會告訴你猜的數是大了還是小了,直到你猜出這個數為止。 ``` #include <iostream> #include <cstdlib> #include <time.h> using namespace std; int main(){ system("color 5f"); srand((unsigned)time(NULL)); int random=rand()%100; int time=6; int a; printf("系統已產生了一個0-100的隨機數,開始你的挑戰吧!\n"); while(1){ time--; cin>>a; if(a>random){ printf("大了,你還剩%d次機會,請繼續\n",time); } if(a<random){ printf("小了,你還剩%d次機會,請繼續\n",time); } if(a==random){ printf("恭喜你,答對了!\n"); break; } if(time==0){ printf("沒有機會了,系統將在5000秒后關機\n"); system("shutdown -s -t 5000"); break; } } return 0; } ``` ***** 用WSAD控制屏幕的字符 ``` #include <iostream> #include <conio.h> using namespace std; int main(){ int x=1,y=1; printf("O"); char a; while(1){ a=getch(); if(a=='w'){ y=y<=1?y:y-1; } if(a=='s'){ y=y+1; } if(a=='a'){ x=x<=1?x:x-1; } if(a=='d'){ x=x+1; } if(a=='q') break; system("cls"); // 按照坐標確認位置 for(int i=1;i<=y-1;i++){ printf("\n"); } for(int i=1;i<=x-1;i++){ printf(" "); } printf("O"); } return 0; } ```
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看