Classic function encapsulation examples (c language)

1. Enter a certain year, month, and day, and determine which day is the day of the year?

Program analysis: Take March 5th as an example, you should first add up the previous two months, and then add 5 days, which is the first day of the year. In special cases, if it is a leap year and the input month is greater than 3, you need to consider adding an extra day .

Input
Please enter the year, month, and day in the format: year, month, and day (2015 12 10)

Output
This is the nth day of the year.

#include<stdio.h>
int addOne ( int year) {
   
    
    
if (year % 4 == 

Guess you like

Origin blog.csdn.net/m0_66656626/article/details/128548318