URI Online Judge | 1020 Age in Days Solve with source code

URI Online Judge | 1020
Age in Days
Adapted by Neilor Tonin, URI  Brazil

Timelimit: 1
Read an integer value corresponding to a person's age (in days) and print it in years, months and days, followed by its respective message “ano(s)”, “mes(es)”, “dia(s)”.

Note: only to facilitate the calculation, consider the whole year with 365 days and 30 days every month. In the cases of test there will never a situation that allows 12 months and some days, like 360, 363 or 364. This is just an exercise for the purpose of testing simple mathematical reasoning.

Input
The input file contains 1 integer value.

Output
Print the output, like the following example.


SOLVE

                              N = int(input())


                              year=N//365
                              N%=365
                              mon=N//30
                              N%=30
                              day =N
                              print(year,"ano(s)")
                              print(mon,"mes(es)")
                              print(day,"dia(s)")


Comments

  1. I am bookmarking it to read it over again after work. It seems like a very interesting topic to write about. Your posts are really helpful to me. Thanks for your wonderful post. I am very happy to read your post.
    www.result-jobs.com

    ReplyDelete

Post a Comment

Popular posts from this blog

How to solve an 8 puzzle problem using A* Algorithm in python

Timus Online Judge 1000. A+B Problem question and SOLVE with sudo code

URI Online Judge | 1013 The Greatest Solve with source code