The eighth Blue Bridge cup competition 17 (java group B) No. 1, the eighth Blue Bridge
1. Title: shopping list
James just found a job. The boss is very nice, but his wife loves shopping. When the boss is busy, he often asks james to help his shopping in the mall. James is bored, but he cannot give up.
No, XX sales promotion is coming again! The boss and wife opened a long shopping order, which offered discounts.
James is also a strange guy. He never needs to swipe his card, but he just needs to pay for it in cash.
James is very upset now. Please help him calculate how much cash he needs from the cash machine to complete the shopping.
Cash machines can only provide banknotes of 100 yuan. Xiaoming wants to get as little cash as possible, just enough.
Your task is to calculate the minimum amount of cash that James needs.
The following is a troublesome shopping list. to protect privacy, the item name is hidden.
-----------------
* *** 180.90 off
* *** 10.25 off
* *** 56.14 off
* *** 104.65 off
* *** 100.30 off
* *** Half price
* *** 26.75 off
* *** Half price
* *** 240.28 off
* *** 270.62 off
* *** 115.87 off
* *** 247.34 off
* *** 73.21 off
* *** Half price
* *** Half price
* *** 278.44 off
* *** Half price
* *** 12.97 off
* *** 166.30 off
* *** 125.50 off
* *** 84.98 off
* *** 113.35 off
* *** Half price
* *** 42.56 off
* *** 81.90 off
* *** 131.78 off
* *** 255.89 off
* *** 109.17 off
* *** 146.69 off
* *** 139.33 off
* *** 141.16 off
* *** 154.74 off
* *** 59.42 off
* *** 85.44 off
* *** 293.70 off
* *** 261.79 off
* *** 11.30 off
* *** 268.27 off
* *** 128.29 off
* *** 251.03 off
* *** 208.39 off
* *** 128.88 off
* *** 62.06 off
* *** 225.87 off
* *** 12.89 off
* *** 34.28 off
* *** 62.16 off
* *** Half price
* *** Half price
* *** 289.69 off
--------------------
It should be noted that a 88% discount is calculated based on the price of 80%, a discount is calculated based on, and the remainder is also calculated.
In particular, the half price is calculated by 50%.
Submit the amount that James wants to extract from the ATM. The unit is yuan.
The answer is an integer similar to 4300. It must end with 00. Do not enter any additional content.
Note: Do not bring a calculator into the venue or open your mobile phone.
You need to learn how to use the ctr + f in eclipse to perform *** search, replace it with null, and then replace half price with 50.
The answer should be noted that the expected result is an integer.
5200
Source code
Public class Main {
// Pay special attention to the failure to generate an error.
Public static void main (String [] args ){
Double [] A = {180.90, 88,
10.25, 65,
56.14, 90,
104.65, 90,
100.30, 88,
297.15, 50,
26.75, 65,
130.62, 50,
240.28, 58,
270.62, 80,
115.87, 88,
247.34, 95,
73.21, 90,
101.00, 50,
79.54, 50,
278.44, 70,
199.26, 50,
12.97, 90,
166.30, 78,
125.50, 58,
84.98, 90,
113.35, 68,
166.57, 50,
42.56, 90,
81.90, 95,
131.78, 80,
255.89, 78,
109.17, 90,
146.69, 68,
139.33, 65,
141.16, 78,
154.74, 80,
59.42, 80,
85.44, 68,
293.70, 88,
261.79, 65,
11.30, 88,
268.27, 58,
128.29, 88,
251.03, 80,
208.39, 75,
128.88, 75,
62.06, 90,
225.87, 75,
12.89, 75,
34.28, 75,
62.16, 58,
129.12, 50,
218.37, 50,
289.69, 80 };
Double sum = 0;
For (int I = 0; I <= A. length-2; I = I + 2 ){
Sum = A [I] * A [I + 1] + sum;
}
System. out. println (sum/100 );
}
}