Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Linq;
- using System.Collections.Generic;
- //tanislav Radkov 11:28 AM
- //Така си го представям, нямам възможност в момента да тествам. Но с тази промяна първата версия която изпрати би трябвало да премахне и 100
- //Count ще намалее като махнеш първите 2-3 числа, но променливата ще пази първоначалната стойност и ще провериш и премахнеш и 100
- class Program
- {
- public enum MonthsOfYear
- {
- January = 1,
- February,
- March,
- April,
- May,
- June,
- July,
- August,
- September,
- October,
- November,
- December
- }
- public static void PrintMonthFromInput(int month)
- {
- if(month < 1 || month > 12)
- {
- Console.WriteLine("Invalid Month!");
- return;
- }
- Console.WriteLine((MonthsOfYear)month);
- }
- static void Main(string[] args)
- {
- Console.WriteLine("Enter a number that corresponds to a month of the year:");
- int month = Convert.ToInt32(1);
- PrintMonthFromInput(month);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement