Advertisement
Josif_tepe

Untitled

Feb 17th, 2024
715
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.98 KB | None | 0 0
  1. #include <iostream>
  2. #include <cmath>
  3. using namespace std;
  4.  
  5. int main() {
  6.     int niza[7];
  7.     for(int i = 0; i < 7; i++) {
  8.         cin >> niza[i];
  9.     }
  10.     int mat[5][6];
  11.     for(int i = 0; i < 5; i++) {
  12.         for(int j = 0; j < 6; j++) {
  13.             cin >> mat[i][j];
  14.         }
  15.     }
  16.     int brojac = 0;
  17.     for(int i = 0; i < 7; i++) {
  18.         int c = niza[i];
  19.         int dali_postoi_brojot = 0;
  20.         for(int x = 0; x < 5; x++) {
  21.             for(int y = 0; y < 6; y++) {
  22.                 if(mat[x][y] == c) {
  23.                     dali_postoi_brojot = 1;
  24.                     mat[x][y] = -1;
  25.                     break;
  26.                 }
  27.             }
  28.             if(dali_postoi_brojot == 1) {
  29.                 break;
  30.             }
  31.         }
  32.         if(dali_postoi_brojot == 1) {
  33.             brojac++;
  34.         }
  35.     }
  36.     if(brojac == 7) {
  37.         cout << "DA" << endl;
  38.     }
  39.     else {
  40.         cout << "NE" << endl;
  41.     }
  42.     return 0;
  43.                
  44. }
  45.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement