[Cpp]/** Copyright and version statement of the program section * Copyright (c) 2013, student * All rightsreserved from computer College of Yantai University. * file name: date. cpp * OPERATOR: Ji Zilong * Completion Date: July 15, March 8, 2013 * version: v1.0 * input Description: year, month, and day * Problem description: The output date corresponds to the day of the year * output: day */# include <iostream> using namespace std; struct Date {int year; int month; int day; int hour; int minu; long second ;}; int sumday (int m); int main () {int days; long dseconds, yseconds; Date date; cout <"please I Nput year month day hour minu, second "<endl; cin> date. year> date. month> date. day> date. hour> date. minu> date. second; if (date. month = 1) days = date. day; if (date. month = 2) days = 31 + date. day; if (date. year % 4 = 0 & date. month> 2) {if (date. month <8) {days = date. day + sumday (date. month)-1;} else {days = date. day + sumday (7) + sumday (date. month-7)-1 ;}} if (date. year % 4! = 0 & date. month> 2) {if (date. month <8) {days = date. day + sumday (date. month)-1;} else {days = date. day + sumday (7) + sumday (date. month-7)-1 ;}/// calculates the number of seconds dseconds = (date. hour-1) * 3600 + (date. minu-1) * 60 + date. second; yseconds = (days-1) * 3600*24 + dseconds; cout <date. month <"month" <date. day <"day is" <date. the day of year <"year" <days <. "<date. minu <"Minute" <date. second <"second is the day" <dseconds <"second, is the year's" <yseconds <"second" <endl; return 0;} int sumday (int m) {if (m-1 = 0) return 0; if (m-1% 2) = 0) return 31 + sumday (m-1 ); else return 30 + sumday (S-1);} running result: