Giter Club home page Giter Club logo

maquina_tempo's Introduction

Maquina_Tempo

en: Python program that simulates a time machine

Context: Maria has created a time machine, and to test it, she wants to visit Russia in the programmer's day between the years 1700 and 2700 (inclusive). Programmer's Day is the 256th of every year.

From 1700 to 1917 Russia used the Julian calendar and from 1919 it fully adopted the Gregorian calendar. The year 1918 was one of transition and, in order to adapt the calendar, it was agreed that the day following January 31st would be February 14th. This means that February 14th was the 32nd day of the year 1918 in Russia.

In both calendars, February is the only month that has a variable number of days, which can have 29 days in leap years or 28 days in normal years.

Leap years:

Julian calendar: Any year divisible by 4;

Gregorian calendar: Years divisible by 400; Years divisible by 4 and not divisible by 100;

Challenge: Given any year y find the date of the programmer's day according to the official Russian calendar of that year. The output of the function must be in the format dd/MM/yyyy, preferably in the standard output of the programming language of your choice.

Conditions:

Input: The function must receive an integer 1700<=y<=2700 Output: programmer date of day in MM/dd/yyyy text format printed to standard output.

Examples:

Input: 2017 Output: 09/13/2017

Input: 1800 Output: 09/12/1800


pt_br: Programa no Python que simula uma máquina do tempo

Contexto: Maria criou uma máquina do tempo, e, para testa-la, quer visitar a Rússia no dia do programador entre os anos 1700 e 2700 ( inclusivo ). O dia do programador é o 256º de cada ano.

De 1700 a 1917 a Rússia utilizava o calendário juliano e a partir de 1919 adotou plenamente o calendário gregoriano. O ano de 1918 foi de transição e, para adaptar o calendário, convencionou-se que o dia seguinte a 31 de janeiro seria 14 de fevereiro. Isso significa que o dia 14 de fevereiro foi 32º dia do ano de 1918 na Rússia.

Em ambos os calendários, fevereiro é o único mês que possui uma quantidade de dias variável, podendo ter 29 dias em anos bissextos ou 28 dias nos anos normais.

Anos Bissextos:

Calendário Juliano: Qualquer ano divisível por 4;

Calendário Gregoriano: Anos divisíveis por 400; Anos divisíveis por 4 e não divisíveis por 100;

Desafio: Dado um ano qualquer y ache a data do do dia do programador de acordo com o calendário oficial Russo daquele ano. A saída da função deve ser no formato dd/MM/yyyy, de preferência na saída padrão da linguagem de programação de sua escolha.

Condições:

Entrada: A função deverá receber um inteiro 1700<=y<=2700 Saída: data do dia do programador em formato de texto dd/MM/yyyy printado na saída padrão.

Exemplos:

Entrada: 2017 Saída: 13/09/2017

Entrada: 1800 Saída: 12/09/1800

maquina_tempo's People

Contributors

malucor avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.