Advertisement
dllbridge

Untitled

Nov 8th, 2022
752
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 1.98 KB | None | 0 0
  1.  
  2. #include   <dllBridge.h>
  3.  
  4. #include  <iostream>
  5. using namespace std;
  6.  
  7.  
  8. void f_input(int);  
  9.  
  10.  
  11.  
  12. int c3 = 0,                                       //  Счётчик троек
  13.     c4 = 0,
  14.     N;                                            //  N – количество элементов...  
  15.                                                   //  ... целочисленного массива  (от 1 до 100 вкл.)
  16.                                                  
  17. int *arr;                                         //  int arr[100];
  18.                                                  
  19. ////////////////////////////////////////////////////
  20. int main()                                        //
  21. {
  22.  
  23.     f_input(2);
  24.    
  25.     N   =  Transit[1][0];
  26.     arr = &Transit[1][1];  
  27.    
  28.     for(int i = 0; i < N; i++)
  29.     {
  30.        
  31.         if(arr[i]%2)    {  cout << arr[i] << " ";  c3 ++;  }        
  32.     }                      cout << endl;
  33.  
  34.     for(int i = 0; i < N; i++)
  35.     {
  36.        
  37.         if(arr[i]%2 == 0) { cout << arr[i] << " ";  c4 ++;  }          
  38.     }                       cout << endl;  
  39.    
  40.    
  41.     if(c4 >= c3) cout << "YES";
  42.     else         cout <<  "NO";  
  43.    
  44.     cout << endl;
  45.     system("pause");
  46. }
  47.  
  48.  
  49.  
  50.  
  51.  
  52.  
  53.  
  54.  
  55.  
  56.  
  57.  
  58.  
  59.  
  60.  
  61.  
  62.  
  63.  
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70.  
  71.  
  72.  
  73.  
  74. /////////////////////////////////////////////////////
  75. void f_input(int n)                                //
  76. {
  77.    
  78.      switch(n)
  79.      {
  80.  
  81.  
  82.          case  1:  Transit[1][0] =  5;
  83.                    Transit[1][1] =  4;
  84.                    Transit[1][2] = 16;
  85.                    Transit[1][3] = 19;
  86.                    Transit[1][4] = 31;
  87.                    Transit[1][5] =  2;
  88.                    break;
  89.    
  90.          case  2:  Transit[1][0] =  8;
  91.                    Transit[1][1] = 29;
  92.                    Transit[1][2] =  4;
  93.                    Transit[1][3] =  7;
  94.                    Transit[1][4] = 12;
  95.                    Transit[1][5] = 15;
  96.                    Transit[1][6] = 17;
  97.                    Transit[1][7] = 24;
  98.                    Transit[1][8] =  1;
  99.                    break;
  100.      }
  101. }
  102.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement