|
|
|
|
if (col - itemIndexTable[row]->Weight > 0)
|
|
for(int row = 0; //...
itemIndexTable[row]->Quantity, itemIndexTable[row]->Name, itemIndexTable[row]->Value;
that's no operation, ¿what was the intent?¿what's the max weight? |
//delete arr for (row = 0; row < totalItem + 1; row++) { delete[] optTable[row]; } delete[] optTable; delete[] itemIndexTable; } |
|
|
No. of items in stock: 5 Maximum weight to carry: 100 Total no. of items: 21 Item no: 1 Name: Pearl Qty: 1 Wt: 25 Val: 10 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 Item no: 2 Name: Ruby Qty: 4 Wt: 40 Val: 12 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 Item no: 3 Name: Ruby Qty: 4 Wt: 40 Val: 12 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 24 24 24 24 24 24 24 24 24 24 24 24 24 24 24 24 24 24 24 24 24 Item no: 4 Name: Ruby Qty: 4 Wt: 40 Val: 12 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 24 24 24 24 24 24 24 24 24 24 24 24 24 24 24 24 24 24 24 24 24 Item no: 5 Name: Ruby Qty: 4 Wt: 40 Val: 12 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 22 22 22 22 22 22 22 22 22 22 22 22 22 22 22 24 24 24 24 24 24 24 24 24 24 24 24 24 24 24 24 24 24 24 24 24 Item no: 6 Name: Diamond Qty: 5 Wt: 30 Val: 15 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 10 10 10 10 10 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 37 37 37 37 37 37 Item no: 7 Name: Diamond Qty: 5 Wt: 30 Val: 15 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 10 10 10 10 10 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 25 25 25 25 25 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 42 Item no: 8 Name: Diamond Qty: 5 Wt: 30 Val: 15 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 10 10 10 10 10 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 25 25 25 25 25 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 40 40 40 40 40 45 45 45 45 45 45 45 45 45 45 45 Item no: 9 Name: Diamond Qty: 5 Wt: 30 Val: 15 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 10 10 10 10 10 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 25 25 25 25 25 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 40 40 40 40 40 45 45 45 45 45 45 45 45 45 45 45 Item no: 10 Name: Diamond Qty: 5 Wt: 30 Val: 15 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 10 10 10 10 10 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 25 25 25 25 25 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 40 40 40 40 40 45 45 45 45 45 45 45 45 45 45 45 Item no: 11 Name: Emerald Qty: 10 Wt: 5 Val: 10 0 0 0 0 0 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 20 20 20 20 20 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 35 35 35 35 35 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 50 50 50 50 50 55 55 55 55 55 55 Item no: 12 Name: Emerald Qty: 10 Wt: 5 Val: 10 0 0 0 0 0 10 10 10 10 10 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 30 30 30 30 30 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 35 45 45 45 45 45 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 60 60 60 60 60 65 Item no: 13 Name: Emerald Qty: 10 Wt: 5 Val: 10 0 0 0 0 0 10 10 10 10 10 20 20 20 20 20 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 40 40 40 40 40 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 55 55 55 55 55 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 70 Item no: 14 Name: Emerald Qty: 10 Wt: 5 Val: 10 0 0 0 0 0 10 10 10 10 10 20 20 20 20 20 30 30 30 30 30 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 50 50 50 50 50 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 65 65 65 65 65 70 70 70 70 70 70 70 70 70 70 70 70 70 70 70 70 70 70 70 70 70 Item no: 15 Name: Emerald Qty: 10 Wt: 5 Val: 10 0 0 0 0 0 10 10 10 10 10 20 20 20 20 20 30 30 30 30 30 40 40 40 40 40 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 60 60 60 60 60 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 65 75 75 75 75 75 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 Item no: 16 Name: Emerald Qty: 10 Wt: 5 Val: 10 0 0 0 0 0 10 10 10 10 10 20 20 20 20 20 30 30 30 30 30 40 40 40 40 40 50 50 50 50 50 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 60 70 70 70 70 70 75 75 75 75 75 75 75 75 75 75 75 75 75 75 75 75 75 75 75 75 75 75 75 75 75 85 85 85 85 85 90 90 90 90 90 90 90 90 90 90 90 Item no: 17 Name: Emerald Qty: 10 Wt: 5 Val: 10 0 0 0 0 0 10 10 10 10 10 20 20 20 20 20 30 30 30 30 30 40 40 40 40 40 50 50 50 50 50 60 60 60 60 60 70 70 70 70 70 70 70 70 70 70 70 70 70 70 70 70 70 70 70 70 70 70 70 70 70 80 80 80 80 80 85 85 85 85 85 85 85 85 85 85 85 85 85 85 85 85 85 85 85 85 85 85 85 85 85 95 95 95 95 95 100 100 100 100 100 100 Item no: 18 Name: Emerald Qty: 10 Wt: 5 Val: 10 0 0 0 0 0 10 10 10 10 10 20 20 20 20 20 30 30 30 30 30 40 40 40 40 40 50 50 50 50 50 60 60 60 60 60 70 70 70 70 70 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 90 90 90 90 90 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 105 105 105 105 105 110 Item no: 19 Name: Emerald Qty: 10 Wt: 5 Val: 10 0 0 0 0 0 10 10 10 10 10 20 20 20 20 20 30 30 30 30 30 40 40 40 40 40 50 50 50 50 50 60 60 60 60 60 70 70 70 70 70 80 80 80 80 80 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 100 100 100 100 100 105 105 105 105 105 105 105 105 105 105 105 105 105 105 105 105 105 105 105 105 105 105 105 105 105 115 Item no: 20 Name: Emerald Qty: 10 Wt: 5 Val: 10 0 0 0 0 0 10 10 10 10 10 20 20 20 20 20 30 30 30 30 30 40 40 40 40 40 50 50 50 50 50 60 60 60 60 60 70 70 70 70 70 80 80 80 80 80 90 90 90 90 90 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 110 110 110 110 110 115 115 115 115 115 115 115 115 115 115 115 115 115 115 115 115 115 115 115 115 115 Item no: 21 Name: Sapphire Qty: 1 Wt: 50 Val: 20 0 0 0 0 0 10 10 10 10 10 20 20 20 20 20 30 30 30 30 30 40 40 40 40 40 50 50 50 50 50 60 60 60 60 60 70 70 70 70 70 80 80 80 80 80 90 90 90 90 90 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 110 110 110 110 110 115 115 115 115 115 115 115 115 115 115 115 115 115 115 115 115 115 115 115 115 120 ANSWER: 120 Program ended with exit code: 0 |