Enter an integer in seconds , Convert to hours 、 Minute and second output . See the example for the output format .( With 24 The hour system shows )
Enter an integer .
Output hours : branch : second , There is a space between each part of the output
11730
3 : 15 : 30
a=eval(input())
h=a//3600
m=a//60%60
s=a%60
print("{} : {} : {}".format(h,m,s))Enter the three sides of the triangle a、b、c, Calculate and output area and perimeter . Suppose that the three sides of the input triangle are legal shaping data . Triangle area formula :
, among s=(a+b+c)/2.
Enter one data per line , Represents one side of a triangle .
area= area ;perimeter= Perimeter , Area and perimeter retention 2 Decimal place
3 4 5
area=6.00;perimeter=12.00
import math # Import math library math.sqrt(x) # call sqrt Function to realize the square operation ,x Data representing the required value
a=eval(input())
b=eval(input())
c=eval(input())
s=(a+b+c)/2
area=(s*(s-a)*(s-b)*(s-c))**0.5
perimeter=a+b+c
print("area={:.2f};perimeter={:.2f}".format(area,perimeter))The store needs change for its customers , Now there are enough sheets , The face values are 50 element 5 Genna 1 element . Enter an integer amount value to give the change scheme , Suppose there is enough RMB , And give priority to coins with large denominations .
Enter... In the first line 1 No more than 1000 The positive integer .
Output the required values for various denominations .
283
50 Number of sheets required for yuan denomination :5 5 Number of sheets required for yuan denomination :6 1 Number of sheets required for yuan denomination :3
a=eval(input())
b=a//50
c=a%50//5
d=a%5
print("50 Number of sheets required for yuan denomination :{}".format(b))
print("5 Number of sheets required for yuan denomination :{}".format(c))
print("1 Number of sheets required for yuan denomination :{}".format(d))Calculate deposit interest , The formula is interest=money×(1+rate)^year−money, interest Is the interest on the deposit when it matures ( pre-tax ),money Is the deposit amount ,year It's the shelf life ,rate It's the annual interest rate .
Input 3 Data , Whitespace separated . The first data represents money, The second data represents year, The third data represents rate
1000 3 0.025
76.89
a,b,c=map(eval,input().split(" "))
interest=a*(1+c)**b-a
print("{:.2f}".format(interest))The user enters two numbers M and N, among N Is an integer , Calculation M and N Of 5 The result of a mathematical operation , And output in turn , The results are separated by spaces .
5 The two mathematical operations are :
M And N And 、M And N The product of the 、M Of N The next power 、M except N The remainder of 、M and N The greater of
10, 2
12 20 100 0 10
10, 2
12 20 100 0 10
a,b=map(eval,input().split(","))
print("{} {} {} {} {}".format((a+b),(a*b),(a**b),(a%b),(max(a,b))))