Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <algorithm>
- using namespace std;
- int porownanie(const void* a, const void* b){
- int x = *(int*)a;
- int y = *(int*)b;
- if(x > y){
- return 1;
- }
- else if(x < y){
- return -1;
- }
- else{
- return 0;
- }
- }
- float* f(float **arr, int size[3]) {
- int n = size[0] + size[1] + size[2];
- float *tmp = new float[n];
- copy(arr[0], arr[0] + size[0], tmp);
- copy(arr[1], arr[1] + size[1], tmp + size[0]);
- copy(arr[2], arr[2] + size[2], tmp + size[0] + size[1]);
- sort(tmp, tmp + n, porownanie);
- copy(tmp, tmp + size[0], arr[0]);
- copy(tmp + n - size[1], tmp + n, arr[1]);
- copy(tmp + size[0], tmp + n - size[1], arr[2]);
- delete[] tmp;
- }
- int main(){
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement