LAB7_919

Run Settings
LanguageC++
Language Version
Run Command
#include <iostream> using namespace std; int main() { const int n = 6 ; int a[n][n]; for ( size_t i = 0 ; i <n ; i++){ for ( size_t j = 0 ; j < n ; j++){ a[i][j] = i ; cout << a[i][j] << " " ; } cout << endl ; } int k , x = (n-1) , y = 0 ; for ( size_t i = 0 ; i <= n/2-1; i++){ for ( size_t j = 0 ; j < n ; j++){ k = a[i][j]; a[i][j] = a[x][y]; a[x][y] = k ; y = y + 1 ; } x = x - 1 ; y = 0 ; } cout << "-------------------------" << endl ; for ( size_t i = 0 ; i <n ; i++){ for ( size_t j = 0 ; j < n ; j++){ cout << a[i][j] << " " ; } cout << endl ; } return 0; }
Editor Settings
Theme
Key bindings
Full width
Lines