#include\x20\x3ciostream\x3e\nusing\x20namespace\x20std;\n\nbool\x20isLeapYear(int\x20year)\x20{\n\x20\x20return\x20(year\x20%\x204\x20==\x200\x20&&\x20year\x20%\x20100\x20!=\x200)\x20||\x20(year\x20%\x20400\x20==\x200);\n}\n\nint\x20main()\x20{\n\x20\x20int\x20year,\x20month,\x20day;\n\x20\x20cin\x20>>\x20year\x20>>\x20month\x20>>\x20day;\n\x20\x20\n\x20\x20int\x20totalDays\x20=\x200;\n\x20\x20int\x20daysInMonth[]\x20=\x20{31,\x2028,\x2031,\x2030,\x2031,\x2030,\x2031,\x2031,\x2030,\x2031,\x2030,\x2031};\n\x20\x20\n\x20\x20if\x20(isLeapYear(year))\x20{\n\x20\x20\x20\x20daysInMonth[1]\x20=\x2029;\n\x20\x20}\n\x20\x20\n\x20\x20for\x20(int\x20i\x20=\x200;\x20i\x20\x3c\x20month\x20-\x201;\x20i++)\x20{\n\x20\x20\x20\x20totalDays\x20+=\x20daysInMonth[i];\n\x20\x20}\n\x20\x20\n\x20\x20totalDays\x20+=\x20day;\n\x20\x20\n\x20\x20cout\x20\x3c\x20totalDays\x20\x3c\x20endl;\n\x20\x20\n\x20\x20return\x200;\n}\n


原文地址: https://www.cveoy.top/t/topic/pRfT 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录