惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

V2EX - 技术
V2EX - 技术
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
Latest news
Latest news
T
The Exploit Database - CXSecurity.com
博客园 - 三生石上(FineUI控件)
WordPress大学
WordPress大学
L
Lohrmann on Cybersecurity
aimingoo的专栏
aimingoo的专栏
B
Blog
T
Threat Research - Cisco Blogs
罗磊的独立博客
Application and Cybersecurity Blog
Application and Cybersecurity Blog
P
Proofpoint News Feed
P
Palo Alto Networks Blog
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
宝玉的分享
宝玉的分享
博客园 - 司徒正美
Google DeepMind News
Google DeepMind News
Blog — PlanetScale
Blog — PlanetScale
T
Tor Project blog
阮一峰的网络日志
阮一峰的网络日志
Last Week in AI
Last Week in AI
Martin Fowler
Martin Fowler
酷 壳 – CoolShell
酷 壳 – CoolShell
Recorded Future
Recorded Future
D
DataBreaches.Net
Y
Y Combinator Blog
大猫的无限游戏
大猫的无限游戏
IT之家
IT之家
B
Blog RSS Feed
Scott Helme
Scott Helme
P
Proofpoint News Feed
V
Vulnerabilities – Threatpost
A
Arctic Wolf
Help Net Security
Help Net Security
L
LINUX DO - 最新话题
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
Vercel News
Vercel News
AWS News Blog
AWS News Blog
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
S
Schneier on Security
Hacker News: Ask HN
Hacker News: Ask HN
N
Netflix TechBlog - Medium
L
LangChain Blog
博客园 - 叶小钗
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
M
MIT News - Artificial intelligence
N
News and Events Feed by Topic
Webroot Blog
Webroot Blog
W
WeLiveSecurity

博客园 - 比尔盖房

USACO: Section 1.5 -- PROB Prime Palindromes USACO: Section 1.5 -- PROB Number Triangles USACO: Section 1.4 -- PROB Arithmetic Progressions USACO: Section 1.3 -- PROB Prime Cryptarithm USACO: Section 1.3 -- PROB Barn Repair USACO: Section 1.3 -- PROB Mixing Milk USACO: Section 1.2 -- PROB Dual Palindromes USACO: Section 1.2 -- PROB Palindromic Squares Programming Pearls: Chatper3 Problem6 [Form letter generator] Programming Pearls: Chatper3 Problem5 [Hyphenation Words] Programming Pearls: Chatper3 Problem3 [Print Banner] Studying Probability Theory Studying "Concrete Mathematics" Studying "Introduction to Algorithms" Testing SEH tips How DebuggerRCThread is lauched? Public Symbols vs Private Symbols[zt] The magic of NativeWindow-- How does .Net Winform manage Win32 controls .Net Windows Service
Programming Pearls: Chatper3 Problem4 [Dates Caculation]
比尔盖房 · 2008-06-14 · via 博客园 - 比尔盖房

The first program

The second program
Lesson Learned: 将

daysInMonth[]的内容拷贝到leapYearDaysInMonth[]的时候忘记将闰二月改为29天... 看来每次写完一条语句都应该verify一下。这个看似浪费时间,却真正能够减少debugging的大量时间呀

The third program
Input:

1981 8
Output: 
    Sunday     Monday    Tuesday  Wednesday   Thursday     Friday   Saturday
                                                                                                   1
         2          3          4          5          6          7                  8
         9         10         11         12         13         14             15
        16         17         18         19         20         21             22
        23         24         25         26         27         28             29
        30         31

Lesson Learned: 居然犯下如此低级的C语言数组下标错误,将pDaysInMonth[month-1]写成了pDaysInMonth[month]。哎,人类语言从1为下标,而C语言从0开始下标。要将此作为我的一个Programming Alarm。。。