fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. const int n = 6;
  5. void read_matrix(int a[][n], int n);
  6. void prnt(int a[],int n);
  7.  
  8. int main() {
  9.  
  10. int M1[n][n];
  11. int M2[n][n];
  12. int result[n];
  13.  
  14. read_matrix(M1,n);
  15. read_matrix(M2,n);
  16.  
  17. for(int i = 0; i < n; i++) {
  18. result[i] = 1;
  19. for(int j = 0; j < n; j++){
  20. if( !(M1[i][j] > M2[i][j]) ) {
  21. result[i] = 0;
  22. break;
  23. }
  24. }
  25. }
  26.  
  27. prnt(result,n);
  28.  
  29. return 0;
  30. }
  31.  
  32. void read_matrix(int a[][n], int n) {
  33. for (int i = 0; i < n; i++) {
  34. for (int j = 0; j < n; j++) {
  35. cin >> a[i][j];
  36. }
  37. }
  38. }
  39.  
  40. void prnt(int a[], int n) {
  41. for (int i = 0; i < n; i++) {
  42. cout << a[i] << " ";
  43. }
  44. }
Success #stdin #stdout 0s 3344KB
stdin
9 8 7 6 7 8
2 3 4 5 6 7
1 9 6 0 3 5
5 8 -2 3 4 5
9 7 6 5 4 3
7 6 4 3 2 6

9 8 7 6 7 8
1 2 2 2 2 2
1 9 6 0 3 5
0 0 -4 0 0 0
9 7 6 5 4 3
1 1 1 1 1 1


2   4  5  6  7  0
5   6  7  3  0  2
-7 9 -5 90 32 11
45  7  -1  3 4  7
2   2   2   2  2  2
5  7  5   8   3  1

1   3 -5  -6  4 -4
2   5  9  4  1  3
7 6 -2 0 56 19
5  6  -2  1 3  0
1  1  1  1  1  1
2    4   7   2  0  1 
stdout
0    1    0    1    0    1