Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int* funkcj(int* begin, int *end, int size,bool* a)
- {
- int t;
- for (int *i= begin; i<=begin+size-1; i++)
- {
- for (int *j = begin; j <= begin + size-2; j++)
- {
- if ((*j % 2 == 0) && (*(j + 1) % 2 == 1))
- {
- t = *(j + 1);
- *(j + 1) = *j;
- *j = t;
- *a = true;
- }
- }
- }
- for (int *i = begin; i <= begin + size - 1; i++)
- {
- if(*i%2==0)
- {
- return i;
- }
- }
- }
- void kolos1()
- {
- bool a=false;
- int r = 13;
- int arr[] = { 1,3,2,14,10,15,5,6,8,9,7,20,21 };
- //rozmiar 13
- funkcj(arr, &arr[12],13,&a);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement