|
|
Namensräume
A02.cs
using System;
class Test {
enum DayOfWeek {Mon, Tue, Wed, Thu, Fri, Sat, Sun}
static System.DayOfWeek Convert(DayOfWeek d) {
switch (d) {
case DayOfWeek.Mon: return System.DayOfWeek.Monday;
case DayOfWeek.Tue: return System.DayOfWeek.Tuesday;
case DayOfWeek.Wed: return System.DayOfWeek.Wednesday;
case DayOfWeek.Thu: return System.DayOfWeek.Thursday;
case DayOfWeek.Fri: return System.DayOfWeek.Friday;
case DayOfWeek.Sat: return System.DayOfWeek.Saturday;
default:/*Sun*/ return System.DayOfWeek.Sunday;
}
}
static void Main(string[] arg) {
foreach (string day in arg) {
DayOfWeek d = (DayOfWeek) Enum.Parse(typeof(DayOfWeek), day);
Console.WriteLine(d + " " + Convert(d));
}
}
}
|
|