Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- for(int i = 2; i<=5;i++){
- for(int j = 0; j<=n;j++){
- if(moedas[i]>j){//(i<matriz[i][j]) onde i deveria ser o peso
- matriz[i][j] = matriz[i-1][j];
- }else{
- matriz[i][j] = matriz[i-1][j]+matriz[i][j-moedas[i]];
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment