Hey guys, here is task number $\boxed{2}$!

As you can see, the name of this is CASHIER.

Plarry the Dinosaur has finally found a job as a cashier! (yay) However, the thing is, he is terrible at mental sum and wants you to write a code to help him in calculating the cost of items.

**Input Details**:

First line inputs *n*.

Next n lines input the cost of the *i*th item.

This line inputs *x*.

The next **x** lines are the items the purchaser bought, the number **i** representing the *i*th item.

**Output Details**:

The total cost of all the items.

**Sample input:**

3

0.25

5.67

10.01

2

3

1

**Sample output**:

10.26

**Explanation for output**:

The 1st item costs 0.25 dollars and the 3rd item costs 10.01 dollars. Thus, the total cost is 10.26 dollars.

No vote yet

1 vote

×

Problem Loading...

Note Loading...

Set Loading...

$</code> ... <code>$</code>...<code>."> Easy Math Editor

`*italics*`

or`_italics_`

italics`**bold**`

or`__bold__`

boldNote: you must add a full line of space before and after lists for them to show up correctlyparagraph 1

paragraph 2

`[example link](https://brilliant.org)`

`> This is a quote`

Remember to wrap math in $</span> ... <span>$ or $</span> ... <span>$ to ensure proper formatting.`2 \times 3`

`2^{34}`

`a_{i-1}`

`\frac{2}{3}`

`\sqrt{2}`

`\sum_{i=1}^3`

`\sin \theta`

`\boxed{123}`

## Comments

Sort by:

TopNewestMy solution in

## C++

Log in to reply

My solution in

## Java

Log in to reply

And here is python2 solution below:

Log in to reply

sorry ur the only one who tried this daniel XD anyway my solution:

Log in to reply

maybe no one saw this post

Log in to reply