SHARE
TWEET

Untitled

a guest Dec 8th, 2019 79 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <stdio.h>
  2. #define N 5
  3. int func_A(int vec[N], int t)
  4. {
  5.     int i;
  6.     int num = 0;
  7.  
  8.     if ((t < 0) || (t > N - 1))
  9.         return 0;
  10.     if (t == 0)
  11.         num = vec[t];
  12.  
  13.     for (i = t + 1; i < N; i++)
  14.     {
  15.         num -= vec[i];
  16.         return num + func_A(vec, ++t); // -----> func_A(vec, ++t) <--- את החלק הזה אני לא בדיוק מבין
  17.     }
  18. }
  19.  
  20. int main()
  21. {
  22.     int vec[N] = { 15,1,1,1,1 };
  23.     int res;
  24.  
  25.     res = func_A(vec, 0);
  26.     printf("res = %d\n", res);
  27.     return 0;
  28. }
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