SHARE
TWEET

Untitled

a guest Feb 19th, 2020 77 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <algorithm>
  2.  
  3. using namespace std;
  4.  
  5. int porownanie(const void* a, const void* b){
  6.     int x = *(int*)a;
  7.     int y = *(int*)b;
  8.  
  9.     if(x > y){
  10.         return 1;
  11.     }
  12.     else if(x < y){
  13.         return -1;
  14.     }
  15.     else{
  16.         return 0;
  17.     }
  18.  
  19. }
  20.  
  21.  
  22. float* f(float **arr, int size[3]) {
  23. int n = size[0] + size[1] + size[2];
  24. float *tmp = new float[n];
  25. copy(arr[0], arr[0] + size[0], tmp);
  26. copy(arr[1], arr[1] + size[1], tmp + size[0]);
  27. copy(arr[2], arr[2] + size[2], tmp + size[0] + size[1]);
  28. sort(tmp, tmp + n, porownanie);
  29. copy(tmp, tmp + size[0], arr[0]);
  30. copy(tmp + n - size[1], tmp + n, arr[1]);
  31. copy(tmp + size[0], tmp + n - size[1], arr[2]);
  32. delete[] tmp;
  33. }
  34.  
  35. int main(){
  36.  
  37.  
  38. return 0;
  39. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top