Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void backT(int kal, int rek, int &k, vector<int> &kalorie, int &ilosc)
- {
- for(int i=rek; i<kalorie.size(); i++)
- {
- if(k==kalorie[i]) ilosc++;
- else if(kal<k)
- {
- kal+=kalorie[i];
- if(k==kal) ilosc++;
- else if(kal<k) backT(kal, i+1, k, kalorie, ilosc);
- kal-=kalorie[i];
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement