AlbertMourato

Untitled

Nov 26th, 2015
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.23 KB | None | 0 0
  1. for(int i = 2; i<=5;i++){
  2.         for(int j = 0; j<=n;j++){
  3.             if(moedas[i]>j){//(i<matriz[i][j]) onde i deveria ser o peso
  4.                 matriz[i][j] = matriz[i-1][j];
  5.             }else{
  6.                 matriz[i][j] = matriz[i-1][j]+matriz[i][j-moedas[i]];
  7.             }
  8.         }
  9.     }
Advertisement
Add Comment
Please, Sign In to add comment