Advertisement
Guest User

Untitled

a guest
Jul 21st, 2017
49
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.46 KB | None | 0 0
  1. int jumpIt(const int arr[], int startIndex, int numOfCol)
  2. {
  3.     if(startIndex >= numOfCol && numOfCol % 2 == 0)
  4.         return arr[numOfCol];
  5.  
  6.     if(startIndex >= numOfCol && numOfCol % 2 != 0)
  7.         return arr[numOfCol];
  8.  
  9.     if(arr[startIndex+1] < arr[startIndex+2] && startIndex+2 != numOfCol)
  10.         return (arr[startIndex] + jumpIt(arr, startIndex+1, numOfCol));
  11.  
  12.     if(arr[startIndex+2] < arr[startIndex+1]);
  13.         return (arr[startIndex] + jumpIt(arr, startIndex+2, numOfCol));
  14.    
  15. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement