Home > other >  Everybody, help to see it
Everybody, help to see it

Time:09-17

Python
Please look at the picture of the three item 3, thank you
To the reference sample is 1 picture of sailor problem (but I still don't know the remaining three problem is how to do it)

CodePudding user response:

 
# 1
Tree_high=98 # tree height
White=10 # day
Night=7.8 # night

Def day () :
X=1
While 1:
If (white - night * x * x) & gt;=(tree_high - 10) :
Return x + 1
X +=1

Print (day ())

# 2
Buyer_num=int (input (" buy how many bottles: "))
If buyer_num & lt; 3:
Print (" can you drink to % s "% buyer_num)
The else:
Num=buyer_num
Sum=0
While 1:
If num>=3:
Num=num//3
The sum + num=
The else:
Break
Print (sum + buyer_num)



# 3

X=10
Y=90
For I in range (120) : # units of time can be set to half a minute 120 units
If (I % 2==1) : # according to the conditions of the subject, just eat every odd number x y
Y=y - x
If (I % 4==0) : # into 4 minutes
Y=y * 2
If (I % 6==0) : # into six minutes
X=x * 2

Print (y)