Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "pch.h"
- #include <iostream>
- #include <ctime>
- using namespace std;
- void main()
- {
- srand(time(NULL));
- int a[10][10];
- cout << "Here is random array size 10*10\n";
- for (int i = 0; i < 10; i++)
- for (int j = 0; j < 10; j++)
- a[i][j] = rand() % 2;
- for (int i = 0; i < 10; i++) {
- for (int j = 0; j < 10; j++) {
- cout << a[i][j] << " ";
- }
- cout << endl;
- }
- int SC = 0;
- for (int i = 0; i < 10; i++)
- for (int j = 0; j < 10; j++) {
- if ((i = j) && (a[i][j] * a[i][j] == 1))
- SC = SC + 1;
- if ((i != j) && (a[i][j] * a[j][i] == 0))
- SC = SC + 1;
- }
- if (SC == 100)
- cout << "Array is orhonormal";
- else
- cout << "Array is not othonormal";
- system("pause");
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement