3181 - Marte3

From Bitnami MediaWiki
Revision as of 09:52, 26 April 2023 by Gheorghe.Tintas (talk | contribs) (Pagină nouă: def marte(): print("Anul martian dureaza x zile martiene") x = int(input()) print("O zi martiana dureaza y ore ") y = int(input()) print("Numarul de antene al lui Iggle ") n = int(input()) a = n // (x * y) # un an martian are x zile, o zi are y ore, deci un an va avea x*y ore, astfel a=n//(x*y) n = n - a * x * y #aflam numarul de ore ramase z = n // y #aflam numarul de zile h = n - z * y print(a, "Ani"...)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
def marte():
    print("Anul martian dureaza x zile martiene")
    x = int(input())
    print("O zi martiana dureaza y ore ")
    y = int(input())
    print("Numarul de antene al lui Iggle ")
    n = int(input())
    a = n // (x * y)  # un an martian are x zile, o zi are y ore, deci un an va avea x*y ore, astfel a=n//(x*y)
    n = n - a * x * y  #aflam numarul de ore ramase
    z = n // y       #aflam numarul de zile
    h = n - z * y
    print(a, "Ani", z, "Zile", h, "Ore");
print(marte());