using System;
using System.Collections.Generic;
using System.Text;
namespace KnowledgePoint
{
class _13_Ex_SumOfDays
{
static void Main(string[] args)
{
try
{
Console.Write("请输入一个年份:");
int year = Convert.ToInt32(Console.ReadLine());
if (year >= 1970 && year <= 2020)
{
try
{
Console.Write("请输入一个月份:");
int month = Convert.ToInt32(Console.ReadLine());
if (month >= 1 && month <= 12)
{
int sumDays = 0; // 天数累加器
switch (month)
{
case 1:
case 3:
case 5:
C#接收一个年份和月份并返回对应天数
最新推荐文章于 2023-02-28 17:08:05 发布
![](https://img-home.csdnimg.cn/images/20240711042549.png)