Year to Century
When working with dates, you often need to quickly tell which century a year belongs to, whether for history, schedules, or clean reports. Write a function century that takes year and returns the century number. Remember the rule: years 1 through 100 are the 1st century, 101 through 200 are the 2nd, and 1900 still belongs to the 19th century.
Примеры
Ввод
1705Вывод
18Ввод
1900Вывод
19Ввод
1601Вывод
17Нужно реализовать
def century(year: int) -> int:
Теги
math
Kirjaudu sisään nähdäksesi palautushistorian
Kirjaudu sisäänKirjaudu sisään käyttääksesi tekoälymentoria
Kirjaudu sisäänVisible tests
1
Input
1705Expected
182
Input
1900Expected
193
Input
1601Expected
174
Input
2000Expected
205
Input
2742Expected
286
Input
-1705Expected
-17Focus radio
Paused · SomaFM · Fluid