From b3175e35f2097b1f80cadd670943c91bc3393939 Mon Sep 17 00:00:00 2001 From: "A.HAMED" <133318802+AHMEDMOM1@users.noreply.github.com> Date: Sun, 29 Dec 2024 12:35:14 +0300 Subject: [PATCH] Update C - Boxes and Candies.cpp --- .../level 2/Atcoder/C - Boxes and Candies.cpp | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/Problem-Solving/level 2/Atcoder/C - Boxes and Candies.cpp b/Problem-Solving/level 2/Atcoder/C - Boxes and Candies.cpp index 6ec8ebf..9e7d492 100644 --- a/Problem-Solving/level 2/Atcoder/C - Boxes and Candies.cpp +++ b/Problem-Solving/level 2/Atcoder/C - Boxes and Candies.cpp @@ -31,15 +31,6 @@ Print the minimum number of operations required to achieve the objective. -/* // Solve in another way -int totalMaxtAmountApple(vector applesInbox, int& x) { - int result{}; - for (int sh : applesInbox) { - result += sh; - } - return result -= x * ceil((double)applesInbox.size() / 2); -} -*/ void prntSmEtngAple(int totalApple, vector & applesInbox) { cout << "Still apple in boxes is: { "; @@ -66,6 +57,16 @@ int totalMaxtAmountApple(vector & applesInbox, int& x) { return totalApple; } +/* // Solve in another way +int totalMaxtAmountApple(vector applesInbox, int& x) { + int result{}; + for (int sh : applesInbox) { + result += sh; + } + return result -= x * ceil((double)applesInbox.size() / 2); +} +*/ + vector inputAppleNumber(int& N, int& x) { do { cout << "N: ";