25.
redTicket
You have a red lottery
ticket showing ints a, b, and c, each of which is 0,
1, or 2. If they are all the value 2, the result is 10. Otherwise if they are
all the same, the result is 5. Otherwise so long as both b and c are
different from a, the result is 1. Otherwise the result is 0.
qizilChipta
Sizda 0, 1, 2 sonlar orasida o`zgarib turadigan 3 ta a, b, c butun
sonlarni ko`rsatuvchi lotariya bileti bor. Agar hamma sonlar 2
bo`lsa 10 soni, boshqa hollarda agar ularning hammasi teng
bo`lsa 5 qaytaring. Boshqa payt b va c a sonidan farqli bo`lsa
natija 1ga teng. Qolgan barcha hollarda natija 0 ga teng.
redTicket(2, 2, 2) → 10
redTicket(2, 2, 1) → 0
redTicket(0, 0, 0) → 5
26.
greenTicket
You have a green lottery ticket, with ints a, b, and c on it. If the numbers
are all different from each other, the result is 0. If all of the numbers are
the same, the result is 20. If two of the numbers are the same, the result
is 10.
Do'stlaringiz bilan baham: