4 solutions

  • 0
    @ 2024-4-8 12:04:01

    #include using namespace std;

    const int MAXN = 2e3 + 5; int n,m,q,x,y,z;

    long long a[MAXN][MAXN]; long long b[MAXN][MAXN];

    int main(){ cin >> n >> m; for (int i=1;i<=2n;i++) for (int j=1;j<=2m;j++) cin >> a[i][j];

    for (int i=1;i<=2*n;i++)
    	for (int j=1;j<=2*m;j++)
    		if (j%2==1)
    			a[i][j] += a[i][j+1];
     
    
    for (int i=1;i<=2*n;i++)
    	for (int j=1;j<=2*m;j++)
    		if (i%2==1)
    			a[i][j] += a[i+1][j];	
    			
    for (int i=1;i<=n;i++)
    	for (int j=1;j<=m;j++)	
    		b[i][j] = a[i*2 - 1][j*2 - 1];
    
    
    for (int i=1;i<=n;i++)
    for (int j=1;j<=m;j++)
    	a[j][i] = b[i][j];
    
    for (int i=1;i<=m;i++){
    	for (int j=1;j<=n;j++)
    		printf("%lld ",a[i][j]);
    	printf("\n");	
    }
    

    }

    • 0
      @ 2024-4-8 11:49:25

      #include using namespace std;

      int main() { int n, m, k; cin >> n >> m >> k; char A[n][m]; for (int i = 0; i < n; i++) { for (int j = 0; j < m; j++) { cin >> A[i][j]; } }

      for (int i = 0; i < n; i++) {
          for (int j = 0; j < k; j++) {
              for (int l = 0; l < m; l++) {
                  for (int p = 0; p < k; p++) {
                      cout << A[i][l];
                  }
              }
              cout << endl;
          }
      }
      
      return 0;
      

      Copy

      }

      • 0
        @ 2024-4-8 11:31:55

        复制上去都有0分

        • 0
          @ 2024-4-8 11:31:28

          #include using namespace std;

          int main() { int n, m, k; cin >> n >> m >> k; char A[n][m]; for (int i = 0; i < n; i++) { for (int j = 0; j < m; j++) { cin >> A[i][j]; } }

          for (int i = 0; i < n; i++) {
              for (int j = 0; j < k; j++) {
                  for (int l = 0; l < m; l++) {
                      for (int p = 0; p < k; p++) {
                          cout << A[i][l];
                      }
                  }
                  cout << endl;
              }
          }
          
          return 0;
          

          }

          • 1

          Information

          ID
          9135
          Time
          3000ms
          Memory
          512MiB
          Difficulty
          1
          Tags
          # Submissions
          65
          Accepted
          35
          Uploaded By