早教吧 育儿知识 作业答案 考试题库 百科 知识分享

C++计算某天是21世纪的第几天?使用C++(数组啊,switch这些基本知识)计算某年某月某天是2000-2009年中的第几天。比如2000年1月1日是第1天,2000年12月31日是第366天,2001年1月1日是367天。附上

题目详情
C++ 计算某天是21世纪的第几天?
使用C++(数组啊,switch这些基本知识)计算某年某月某天是2000-2009年中的第几天。比如2000年1月1日是第1天,2000年12月31日是第366天,2001年1月1日是367天。
附上原题目:
            
                
                    
                        
                            
Now make a function that tells you what day of the century it is. If you take 1st
January 2000 as day 1, everything works out nicely. So 31st December 2000 was day
366, and 1st January 2001 was day 367, and so on. You still only need to be
concerned with this century, 2000 to 2099.
▼优质解答
答案和解析

我是在程序中指定了结束日期,如果需要,你自行加上命令行读入该日期,very easy.