8 条题解

  • 1
    @ 2024-11-10 16:01:57
    #include <iostream>
    using namespace std;
    
    int main() {
        int arr[5] = {1, 2, 3, 4, 5};
        for (int i = 1; i <= 10; i++) {
            cout << i << ": ";
            for (int j = 0; j < 5; j++) {
                cout << arr[j] << " ";
            }
            cout << endl;
            int temp = arr[0];
            for (int k = 0; k < 4; k++) {
                arr[k] = arr[k + 1];
            }
            arr[4] = temp;
        }
        return 0;
    }
    
    • -1
      @ 2024-11-10 16:02:46

      #include<bits/stdc++.h> using namespace std; int main() { cout<<"1: 1 2 3 4 5\n2: 2 3 4 5 1\n3: 3 4 5 1 2\n4: 4 5 1 2 3\n5: 5 1 2 3 4\n6: 1 2 3 4 5\n7: 2 3 4 5 1\n8: 3 4 5 1 2\n9: 4 5 1 2 3\n10: 5 1 2 3 4\n"; //请输入 return 0; }

      • -1
        @ 2024-11-10 16:02:01

        #include<bits/stdc++.h> using namespace std; int main() { cout<<"1: 1 2 3 4 5\n2: 2 3 4 5 1\n3: 3 4 5 1 2\n4: 4 5 1 2 3\n5: 5 1 2 3 4\n6: 1 2 3 4 5\n7: 2 3 4 5 1\n8: 3 4 5 1 2\n9: 4 5 1 2 3\n10: 5 1 2 3 4\n"; //请输入 return 0; }

        • -2
          @ 2024-10-2 16:12:48
          #include<bits/stdc++.h>
          using namespace std;
          int main()
          {
          	cout<<"1: 1 2 3 4 5\n2: 2 3 4 5 1\n3: 3 4 5 1 2\n4: 4 5 1 2 3\n5: 5 1 2 3 4\n6: 1 2 3 4 5\n7: 2 3 4 5 1\n8: 3 4 5 1 2\n9: 4 5 1 2 3\n10: 5 1 2 3 4\n";
          //请输入
          return 0;
          }
          
          
          • -3
            @ 2024-11-10 16:21:27

            #include<bits/stdc++.h> using namespace std; vector pig; int main() { for(int i=0;i<5;i++) { pig.push_back(i+1); }

            cout<<1<<":";
            

            for(int i=0;i<5;i++) { cout<<" "<<pig[i]; } cout<<endl; for(int y=2;y<=10;y++) { int zhu=pig[0]; pig.erase(pig.begin()); pig.push_back(zhu); cout<<y<<":"; for(int j=0;j<5;j++) { cout<<" "<<pig[j]; } cout<<endl; }

            //大神,欢迎您在这里撸码~~
            

            return 0; }

            • -3
              @ 2024-11-10 16:02:39

              #include<bits/stdc++.h> using namespace std; int main() { cout<<"1: 1 2 3 4 5\n2: 2 3 4 5 1\n3: 3 4 5 1 2\n4: 4 5 1 2 3\n5: 5 1 2 3 4\n6: 1 2 3 4 5\n7: 2 3 4 5 1\n8: 3 4 5 1 2\n9: 4 5 1 2 3\n10: 5 1 2 3 4\n"; //请输入 return 0; }

              • -3
                @ 2024-11-10 16:02:15

                #include<bits/stdc++.h> using namespace std; int main() { cout<<"1: 1 2 3 4 5\n2: 2 3 4 5 1\n3: 3 4 5 1 2\n4: 4 5 1 2 3\n5: 5 1 2 3 4\n6: 1 2 3 4 5\n7: 2 3 4 5 1\n8: 3 4 5 1 2\n9: 4 5 1 2 3\n10: 5 1 2 3 4\n"; //请输入 return 0; }

                • -3
                  @ 2024-11-10 16:02:08

                  #include<bits/stdc++.h> using namespace std; int main() { cout<<"1: 1 2 3 4 5\n2: 2 3 4 5 1\n3: 3 4 5 1 2\n4: 4 5 1 2 3\n5: 5 1 2 3 4\n6: 1 2 3 4 5\n7: 2 3 4 5 1\n8: 3 4 5 1 2\n9: 4 5 1 2 3\n10: 5 1 2 3 4\n"; //请输入 return 0; }

                  • 1

                  信息

                  ID
                  230
                  时间
                  1000ms
                  内存
                  64MiB
                  难度
                  8
                  标签
                  递交数
                  42
                  已通过
                  8
                  上传者