全年中6位数字都不相同的日期

  • 时间:2020-06-17 18:43:17
  • 分类:数学世界
  • 阅读:88 次

全年中6位数字都不相同的日期:有一种用6位数表示日期的方法,例如:940812表示1994年8月12日,用这种方法表示1991年全年的日期,那么全年中6位数字都不相同的日期共有多少天?

此题解答如下:采用尝试的方法。首先摆摆一月的情况:9101□□,发现1重复了,所以一月六位数字各不相同的日期没有。再看二月的情况:9102□□,因为0、1和2前面都已有了,而二月又没有三十几号,第五位不能为0、1、2、3,所以二月符合要求的天数也没有。

看看三月:9103□□,0、1和3前面已经有了,所以第五位只能用2,这样符合要求的日期便有3月24号、25号、26号、27号、28号,共有5天。

同理四有也有5天符合要求,五月、六月……同样如此,请你思考一下,最多可以到几月份?

对了,只能到八月份。因为9前面已经有了,而十月、十一月、十二月都要用到1,前面也用过了。

所以,只有三~八月,共有6个月里有符合要求的日期,且各为5天(想想为什么都恰好是5天?)

最后总天数为:5×6=30(天)。

推荐阅读:
C++ Algorithm to Compute the One-Dimensional (Linear) Interpolat  C++ Algorithms to Find Pair of Sum Given a Collection of Numbers  How to Implement strStr() function in C++?  How to Check Valid Word Abbreviation in C++?  CloudFlare Enterprise Plan Overview  Powerful Integers by Bruteforce Algorithm using C++  How to Check if Any Three Points can Make a Triangle?  How to Convert Set to Vector in C++?  Peeple App Embodies the Worst of Social Media  10 Best Writing Quotes for Bloggers 
评论列表
添加评论