josiftepe

Untitled

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