5 条题解

  • 3
    @ 2023-4-9 20:01:53
    #include <queue>
    #include <math.h>
    #include <stack>
    #include <stdio.h>
    #include <iostream>
    #include <vector>
    #include <iomanip>
    #include <string.h>
    #include <algorithm>
    using namespace std;
    #define LL long long
    const int N = 1e6 + 10;
    const int INF = 0x3f3f3f3f;
    int a[10][10];
    int main()
    {
    	for(int i = 1; i <= 6; i++)
        {
            for(int j = 1; j <= 6; j++)
            {
                cin >> a[i][j];
                if(i == j)
                {
                    a[i][j] += 10;
                }
                if(i + j == 7)
                {
                    a[i][j] += 10;
                }
            }
        }
        for(int i = 1; i <= 6; i++)
        {
            for(int j = 1; j <= 6; j++)
            {
                cout << a[i][j] << " ";
            }
            puts("");
        }
    	return 0;
    }
    
    
    • 1
      @ 2023-11-8 19:57:43
      #include <queue>
      #include <math.h>
      #include <stack>
      #include <stdio.h>
      #include <iostream>
      #include <vector>
      #include <iomanip>
      #include <string.h>
      #include <algorithm>
      using namespace std;
      #define LL long long
      const int N = 1e6 + 10;
      const int INF = 0x3f3f3f3f;
      int a[10][10];
      int main()
      {
      	for(int i = 1; i <= 6; i++)
          {
              for(int j = 1; j <= 6; j++)
              {
                  cin >> a[i][j];
                  if(i == j)
                  {
                      a[i][j] += 10;
                  }
                  if(i + j == 7)
                  {
                      a[i][j] += 10;
                  }
              }
          }
          for(int i = 1; i <= 6; i++)
          {
              for(int j = 1; j <= 6; j++)
              {
                  cout << a[i][j] << " ";
              }
              puts("");
          }
      	return 0;
      }
      
      • 1
        @ 2022-11-28 9:26:37

        水题解了

        #include <queue>
        #include <math.h>
        #include <stack>
        #include <stdio.h>
        #include <iostream>
        #include <vector>
        #include <iomanip>
        #include <string.h>
        #include <algorithm>
        using namespace std;
        #define LL long long
        const int N = 1e6 + 10;
        const int INF = 0x3f3f3f3f;
        int a[10][10];
        int main()
        {
        	for(int i = 1; i <= 6; i++)
            {
                for(int j = 1; j <= 6; j++)
                {
                    cin >> a[i][j];
                    if(i == j)
                    {
                        a[i][j] += 10;
                    }
                }
            }//一条对角线+输入
            for(int i = 1; i <= 6; i++)
            {
                for(int j = 1; j <= 6; j++)
                {
                    if(i + j == 7)//稍微观察一下便知
                    {
                        a[i][j] += 10;
                    }
                }
            }//另一条对角线
            for(int i = 1; i <= 6; i++)
            {
                for(int j = 1; j <= 6; j++)
                {
                    cout << a[i][j] << " ";
                }
                puts("");
            }//输出
        	return 0;
        }
        

        可以缩减成这样

        #include <queue>
        #include <math.h>
        #include <stack>
        #include <stdio.h>
        #include <iostream>
        #include <vector>
        #include <iomanip>
        #include <string.h>
        #include <algorithm>
        using namespace std;
        #define LL long long
        const int N = 1e6 + 10;
        const int INF = 0x3f3f3f3f;
        int a[10][10];
        int main()
        {
        	for(int i = 1; i <= 6; i++)
            {
                for(int j = 1; j <= 6; j++)
                {
                    cin >> a[i][j];
                    if(i == j)
                    {
                        a[i][j] += 10;
                    }
                    if(i + j == 7)
                    {
                        a[i][j] += 10;
                    }
                }
            }
            for(int i = 1; i <= 6; i++)
            {
                for(int j = 1; j <= 6; j++)
                {
                    cout << a[i][j] << " ";
                }
                puts("");
            }
        	return 0;
        }
        
        • 1
          @ 2022-10-21 22:05:45

          #include<stdio.h>
          #include<iostream>
          using namespace std;
          #define LL long long
          const int N=1e6+10;
          const int INF=0x3f3f3f3f;
          int a[15][15];
          int main(){
          for(int i=1;i<=6;i++)
          for(int j=1;j<=6;j++)
          cin>>a[i][j];
          int sum=1,pro=1,x=6;
          for(int i=1;i<=6;i++){
          for(int j=1;j<=6;j++){
          a[sum][pro]+=10;
          a[sum][x]+=10;
          sum++;
          pro++;
          x--;
          }
          }
          for(int i=1;i<=6;i++){
          for(int j=1;j<=6;j++)
          cout<<a[i][j]<<" ";
          cout<<endl;
          }
          }

          • 0
            @ 2023-4-13 22:38:07
            using namespace std;
            #define LL long long
            const int N = 1e6 + 10;
            const int INF = 0x3f3f3f3f;
            int a[10][10];
            int main(){
            	for(int i = 1; i <= 6; i++){
                    for(int j = 1; j <= 6; j++){
                        cin >> a[i][j];
                        if(i == j){
                            a[i][j] += 10;
                        }
                        if(i + j == 7){
                            a[i][j] += 10;
                        }
                    }
                }
            	for(int i = 1; i <= 6; i++){
                    for(int j = 1; j <= 6; j++){
                        cout << a[i][j] << " ";
                    }
                    puts("");
                }
            	return 0;
            }
            
            
            • 1

            信息

            ID
            1052
            时间
            1000ms
            内存
            128MiB
            难度
            3
            标签
            递交数
            239
            已通过
            120
            上传者