Quick actions

cmd+k|ctrl+k

Navigation

Languages

Lab 7(2)

Snippet info

Language

Cpp

Visibility

public

Author

diety

Created

2018-12-21T05:33:27Z

Updated

2018-12-21T05:33:27Z

#include <iostream>
using namespace std;

int main() {
    int a[5][5];
    for ( int i = 0 ; i <= 4 ; i++){
        for ( int j = 0 ; j <= 4 ; j++){
            a[i][j] =  rand () % 2;
            cout <<  a[i][j] << "   ";
        }
        cout << endl << endl ; 
    }
    cout << "Введите K и P (k && p <= 5)" << endl ; 
    int k , p ; 
    cin >> k >> p ; 
    
     for ( int i = 0 ; i <= 4 ; i++){
        a[k-1][i] =  a[k-1][i] + a[p-1][i];
        
        
    }
    cout << "======Конечный массив======" << endl ; 
     for ( int i = 0 ; i <= 4 ; i++){
        for ( int j = 0 ; j <= 4 ; j++){
            cout <<  a[i][j] << "   ";
        }
        cout << endl << endl ; 
    }
    
    
    return 0;
}
INFO