Quick actions

cmd+k|ctrl+k

Navigation

Languages

lab7_913

Snippet info

Language

Cpp

Visibility

public

Author

maloy-

Created

2018-12-11T21:26:00Z

Updated

2018-12-11T21:26:00Z

#include <iostream>
using namespace std;

int main() {
    const int n = 6 ; 
    int a[n][n] , b[n] ; 
    
    for (size_t i = 0 ; i < n ; i++){
        for (size_t j = 0 ; j < n ; j++){
            a[i][j] = rand () % 10 ; 
            cout << a[i][j] << "  " ;
        }
        cout << endl ; 
    }
    int sum = 0 , x = 0 ; 
    for (size_t i = 0 ; i < n ; i++){
        for (size_t j = 0 ; j < n ; j++){
            sum += a[i][j] ; 
        } 
        b[x] =  (sum / n);
        x++;
        sum=0;
    }
    
    cout << endl ; 
    int min = 100 , k=0; 
    for (size_t i = 0 ; i < x ; i++){
        cout << b[i] << "  ";
        if (b[i] < min ){
        min = b[i];
        k = i + 1 ; 
        }
    }
     cout << endl << "Минимальная строка со сред.арифм. = " << k << " и eё знаяение = " << min <<  endl ; 
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    return 0;
}
INFO