LAB7_1080_dop

Run Settings
LanguageC++
Language Version
Run Command
#include <iostream> using namespace std; int main() { const int x = 12 , y = 1 ; int a[x][y] , b[x][y]; for (size_t i = 0 ; i < x ; i++){ cout << i+1 << " ====\t" ; for(size_t j = 0 ; j < y ; j++){ a[i][j] = rand() % 99 ; cout << a[i][j] << "\t" ; } cout << endl ; } int x1 = 0 , x2 = 1 , x3 = x ; for (size_t i = 0 ; i < x ; i+=2){ for(size_t j = 0 ; j < y ; j++){ b[i][j] = a[x1][j]; } x1++; } x1=x-1; for (size_t i = 1 ; i < x ; i+=2){ for(size_t j = 0 ; j < y ; j++){ b[i][j] = a[x1][j]; } x1--; } for (size_t i = 0 ; i < x ; i++){ for(size_t j = 0 ; j < y ; j++){ cout << b[i][j] << "\t" ; } cout << endl ; } return 0; }
Editor Settings
Theme
Key bindings
Full width
Lines