Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <string>
- using namespace std;
- int main() {
- int n;
- cin >> n;
- int mat[n][n * 2];
- for(int i = 0; i < n; i++) {
- for(int j = 0; j < n * 2; j++) {
- cin >> mat[i][j];
- }
- }
- int res_mat[n * 2][n];
- for(int i = 0; i < n; i++) {
- for(int j = 0; j < n; j++) {
- res_mat[i][j] = mat[i][j];
- }
- }
- for(int i = 0; i < n; i++) {
- int tmp_j = 0;
- for(int j = n; j < n * 2; j++) {
- res_mat[i + n][tmp_j] = mat[i][j];
- tmp_j++;
- }
- }
- for(int i = 0; i < n * 2 ;i++) {
- for(int j = 0; j < n; j++) {
- cout << res_mat[i][j] << " ";
- }
- cout << endl;
- }
- return 0;
- }
- /*
- 3
- 1 2 3 4 5 6
- 7 8 9 10 11 12
- 13 14 15 16 17 18
- **/
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement