시간 제한 | 메모리 제한 | 제출 | 정답 | 맞힌 사람 | 정답 비율 |
---|---|---|---|---|---|
1 초 | 128 MB | 9 | 4 | 4 | 57.143% |
Madam Phoenix (from Problem A) hasn't been too successful with her new numerology business, so she's moving to the southwest to open a "Fun In The Sun" store selling sunglasses, sunscreen, and other such items. Even though she didn't make a profit using your last program, she's decided to employ you again to write an inventory program for her new store. Here's how it will work.
Eachd "activity" your program is to process will appear as a separate line in the input file. Then end of the input is marked by a line containing an asterisk in column one; no other activity lines will be so marked. Activity lines begin with a lower-case keyword identifying he action to be performed. The names of the items in her inventory are case sensitive, and each contains no more than ten non-blank characters. All fields in the activity lines are separated by blanks, and Madam Phoenix guarantees you that there will be no errors in the input. Here are the various types of activity lines your program is to process.
new Shade01 0.50 3.79 new Towel01 1.47 6.98 new Shade02 0.63 4.29 new BluBlock 1.00 4.98 buy BluBlock 100 sell BluBlock 2 buy Towel01 500 buy Shade01 100 buy Shade02 100 sell Towel01 1 sell Towel01 1 sell BluBlock 2 report delete Shade01 sell BluBlock 5 new Shade03 0.51 1.98 buy Shade03 250 sell Towel01 5 sell Shade03 4 sell Shade02 10 report *
INVENTORY REPORT Item Name Buy At Sell At On Hand Value --------- ------ ------- ------- ----- BluBlock 1.00 4.98 96 96.00 Shade01 0.50 3.79 100 50.00 Shade02 0.63 4.29 100 63.00 Towel01 1.47 6.98 498 732.06 ------------------------ Total value of inventory 941.06 Profit since last report 26.94 INVENTORY REPORT Item Name Buy At Sell At On Hand Value --------- ------ ------- ------- ----- BluBlock 1.00 4.98 91 91.00 Shade02 0.63 4.29 90 56.70 Shade03 0.51 1.98 246 125.46 Towel01 1.47 6.98 493 724.71 ------------------------ Total value of inventory 997.87 Profit since last report 39.93