Enter the month and date to get the first day of the year

Source: Internet
Author: User

Console.WriteLine ("Please enter a few months and the number of days for you to figure out the day of the Year");
int m1 = to, M2 = 31, M3 = To, M4 =, M5 = To, M6 =, M7 = to, M8 = to, M9 =, M10 =, M11 =--M12
Console.Write ("Please enter the month:");
int m = Convert.ToInt32 (Console.ReadLine ());
Console.Write ("Please enter the date:");
int d = Convert.ToInt32 (Console.ReadLine ());
if (d >= 1 && d <= 31)
{


Switch (m)
{
Case 1:
Console.WriteLine ("This year's {0}", D, "Day");
Break

Case 2:
Console.WriteLine ("This year's {0}", M1 + D, "Day");
Break

Case 3:
Console.WriteLine ("This year's {0}", M1 + m2 + D, "Day");
Break

Case 4:
Console.WriteLine ("This year's {0}", M1 + m2 + m3 + D, "Day");
Break

Case 5:
Console.WriteLine ("This year's {0}", M1 + m2 + m3 + m4 + D, "Day");
Break

Case 6:
Console.WriteLine ("This year's {0}", M1 + m2 + m3 + M4 + m5 + D, "Day");
Break

Case 7:
Console.WriteLine ("This year's {0}", M1 + m2 + m3 + M4 + M5 + M6 + D, "Day");
Break
Case 8:
Console.WriteLine ("This year's {0}", M1 + m2 + m3 + M4 + M5 + M6 + M7 + D, "Day");
Break

Case 9:
Console.WriteLine ("This year's {0}", M1 + m2 + m3 + M4 + M5 + M6 + M7 + m8 + D, "Day");
Break

Case 10:
Console.WriteLine ("This year's {0}", M1 + m2 + m3 + M4 + M5 + M6 + M7 + m8 + M9 + D, "Day");
Break

Case 11:
Console.WriteLine ("This year's {0}", M1 + m2 + m3 + M4 + M5 + M6 + M7 + m8 + M9 + M10 + D, "Day");
Break

Case 12:
Console.WriteLine ("This year's {0}", M1 + m2 + m3 + M4 + M5 + M6 + M7 + m8 + M9 + M10 + M11 + D, "Day");
Break
Default

Console.WriteLine ("Entered month error");
Break


}
}
Else
{
Console.WriteLine ("The date entered is incorrect. ");
}

Enter the month and date to get the first day of the year

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.