Advertisement
Guest User

Untitled

a guest
Feb 20th, 2019
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.37 KB | None | 0 0
  1. void backT(int kal, int rek, int &k, vector<int> &kalorie, int &ilosc)
  2. {
  3. for(int i=rek; i<kalorie.size(); i++)
  4. {
  5. if(k==kalorie[i]) ilosc++;
  6. else if(kal<k)
  7. {
  8. kal+=kalorie[i];
  9. if(k==kal) ilosc++;
  10. else if(kal<k) backT(kal, i+1, k, kalorie, ilosc);
  11. kal-=kalorie[i];
  12. }
  13. }
  14. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement