Quick actions

cmd+k|ctrl+k

Navigation

Languages

lab6-159

Snippet info

Language

Cpp

Visibility

public

Author

matho.camara

Created

2018-11-28T08:54:10Z

Updated

2018-12-12T09:18:36Z

#include <iostream>
#include <time.h>
using namespace std;

int main() {
    srand((unsigned) time(NULL));
    int table[5][5];
    for(int i=0;i<5;i++)
    {
        for(int j=0;j<5;j++)
        table[i][j]=rand()%50;
    }   
    
    //normal view
    cout << "Normal view"<<endl;
    for(int i=0;i<5;i++)
    {
        for(int j=0;j<5;j++)
        cout<<table[i][j]<<"  ";
        cout<<endl;
    } 
    
    //reverse view
    cout<<endl;
    cout << "Reverse view"<<endl;
    for(int i=0;i<5;i++)
    {
        for(int j=0;j<5;j++)
        cout<<table[j][i]<<"  ";
        cout<<endl;
    } 
    return 0;
}
INFO