Quick actions

cmd+k|ctrl+k

Navigation

Languages

lab7_983

Snippet info

Language

Cpp

Visibility

public

Author

maloy-

Created

2018-12-11T21:35:45Z

Updated

2018-12-11T21:35:45Z

#include <iostream>
using namespace std;
#include <cmath>
int main() {
    const int n = 6 ; 
    float a[n][n] ; 
    int k = 0 ; 
    for(size_t i = 0 ; i < n ; i++){
        for(size_t j = 0 ; j < n ; j++){
            a[i][j] = sin((pow(i,2)-pow(j,2)) / n); 
            cout << a[i][j] << "     " ;
            if ( a[i][j] > 0 )
            k++;
        }
        cout << endl ;
    }
    cout << "кол. положительных элементов : " << k << endl ; 
    
    return 0;
}
INFO