Advertisement
Guest User

Untitled

a guest
Apr 18th, 2019
108
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.51 KB | None | 0 0
  1. A masyvas n = 8
  2. 37 58 125 200 545 685 721 49
  3. B masyvas m = 5
  4. 48 52 66 133 200
  5.  
  6. void Edit(int A[], int &n, int B[], int &m)
  7. {
  8.     int count = 0;
  9.     int x;
  10.     int copy = 0;
  11.     int spot = 0;
  12.     for (int i = 0; i < n; i++)
  13.     {
  14.         x = A[i];
  15.         while (x > 0)
  16.         {
  17.             x = x / 10;
  18.             count++;
  19.         }
  20.         if (count == 2)
  21.         {
  22.             B[m + copy] = A[i];
  23.             m++;
  24.             count = 0;
  25.             spot = i;
  26.             removal(spot, A, n);
  27.         }
  28.     }
  29.    
  30. }
  31. void removal (int s, int C[], int &k)
  32. {
  33.     for (int i = s; i < k ; i++)
  34.     C[i] = C[i + 1];
  35.     k--;
  36. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement