LAB7_1059

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] = j; cout << a[i][j] << " " ; } cout << endl ; } int k , x = 0 , y = n-1 ; for ( size_t j = 0 ; j <= n/2-1 ; j++){ for ( size_t i = 0 ; i < n ; i++){ k = a[i][j]; a[i][j] = a[x][y]; a[x][y] = k ; x = x + 1 ; } y = y - 1 ; x=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