markdown C# - JS - Python - 算法:从一年开始的世纪

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了markdown C# - JS - Python - 算法:从一年开始的世纪相关的知识,希望对你有一定的参考价值。

int centuryFromYear(int year) {
    return 1 + (year-1)/100;
}
function centuryFromYear(year) {
    return 1 + Math.floor((year-1)/100)
}
def centuryFromYear(year):
    # // -> Floor division - division that results into whole number adjusted to the left in the number line. Example: 15//4 = 3
    return 1 + (year - 1) // 100
# Description:
Given a year, return the century it is in. 
The first century spans from the year 1 up to and including the year 100, 
the second - from the year 101 up to and including the year 200, etc.

以上是关于markdown C# - JS - Python - 算法:从一年开始的世纪的主要内容,如果未能解决你的问题,请参考以下文章

markdown C# - JS - Python - 算法:从一年开始的世纪

前端学习必备精选文章60篇:JS正则表达式markdown语法前端面试

vue使用marked.js实现markdown转html并提取标题生成目录

博客园里Markdown支持高亮显示的语言

Vue3.0中读取本地Markdown文件的内容

js 数组中如何删除字典