Goal:
- Get every integer from the string (not a number, but integer)
- Multiply them
- Output the result
Input:
5 kilograms of food eaten, 10 liters of water drank, 20 plates dirty, 40 mugs dirty, and only 3 people acted!
Output:
120000
How:
Result was 5 * 10 * 20 * 40 * 3
What do we count as an integer:
General:
- If integer has a symbol BEFORE of AFTER the int, only take the number without symbols.
-335 or 335+
are 335 anyways. If integer has a symbol like this:
35:3
, don't take it.35 : 3
is available though, and considered as 2 integers.Detailed:
35/3 aren't two integers, skip this
- 35.3 is not an integer, skip this
- 35:3, 35*3, 3e3, etc. aren't ints, skip them as well
- 353 is an integer
- 35 3 are two integers
- is an integer
- 353?, 353!, etc. are integers
- -353 is an integer, but you only claim 353 and skip "-".
+353 is the same case as upper
Requirements:
Select any language you want
- The program should contain as little bytes as possible
- You should tell us the language (if it's, like, exotic, link it like this)
- Please, upload the code to Try It Online services like this
- Count the bytes using special services like this
- It would be fine if you'd explain your code!
Scoring:
Less bytes program wins! The end is 20th of June, you guys have a week
3.45
(which we should then discard)? \$\endgroup\$ – Luis Mendo Jun 13 '20 at 16:1413/06/2020
? In general, you should specify exactly what counts as an integer to be extracted and what doesn't \$\endgroup\$ – Luis Mendo Jun 13 '20 at 16:15