Array Manipulation Advanced - помощ
Здравейте, докарвам до 50/100, това е кодът ми: https://pastebin.com/SBQvaMK3
Не схващам какво пропускам в условието.
6. Array Manipulation Advanced
Now we need to extend the functionality of the previous task and we will implement more complicated array commands. Again, read an array, and until you receive "end" read commands:
Contains {number} – check if the array contains the number. If yes print "Yes", otherwise print "No such number"
Print even – print all the numbers that are even separated by a space
Print odd – print all the numbers that are odd separated by a space
Get sum – print the sum of all the numbers
Filter ({condition} {number}) – print all the numbers that fulfill that condition. The condition will be either '<', '>', ">=", "<="
Example
Input |
Output |
2 13 43 876 342 23 543 Contains 100 Contains 543 Print even Print odd Get sum Filter >= 43 Filter < 100 end |
No such number Yes 2 876 342 13 43 23 543 1842 43 876 342 543 2 13 43 23 |