本文介绍了如何查看是否是周六/周日?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!
问题描述
这段代码的作用是打印本周从星期一到星期五的日期.它工作得很好,但我想问点别的:如果今天是周六或周日,我希望它在下周显示.我该怎么做?
What this code does is print the dates of the current week from Monday to Friday. It works fine, but I want to ask something else: If today is Saturday or Sunday I want it to show the next week. How do I do that?
这是我目前的工作代码(感谢 StackOverflow!):
Here's my working code so far (thanks to StackOverflow!!):
非常感谢!我真的很感激它,因为我已经寻找了几个小时的解决方案......
Thanks a lot! I really appreciate it as I've been searching for the solution for hours...
推荐答案
输出
如果你想变得可爱,可以将 if/then/else 替换为
If you want to be cute you can replace the if/then/else with
但我真的想要一些易于理解和可读的东西.
but I really wanted something easily understood and readable.
这篇关于如何查看是否是周六/周日?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!
本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!