static Int16[] versatz = new Int16[13];
static String[] wochentagText = new String[8];
public static void fuelle(Int16 schalttag)
versatz[1] =Convert.ToInt16(6-schalttag ) ;
versatz[2] =Convert.ToInt16(2-schalttag ) ;
public static void Main()
Int16 jahr=0, monat=0, tag=0;
Console.WriteLine("Welcher Wochentag");
Console.WriteLine("Bitte gib ein Jahr ab 2000 ein");
jahr = Convert.ToInt16(Console.ReadLine());
Console.WriteLine("Bitte gib einen Monat (1-12) ein");
monat= Convert.ToInt16(Console.ReadLine());
Console.WriteLine("Bitte gib ein Tag (1-31) ein");
tag = Convert.ToInt16(Console.ReadLine());
if (jahr%4 == 0) schaltjahr=1;
JHRest= Convert.ToInt16(jahr%100);
Schaltjahre = Convert.ToInt16( JHRest /4 );
Teilsumme = Convert.ToInt16(JHRest + Schaltjahre);
Restwoche = Convert.ToInt16(Teilsumme % 7);
Wochentag= Convert.ToInt16((tag + versatz[monat] + Restwoche)%7);
Console.WriteLine("Der " + tag.ToString() +"." + monat.ToString() +"." + jahr.ToString());
Console.WriteLine("Der Wochentag ist ein " + Wochentag.ToString() + ": " + wochentagText[Wochentag]);
Console.WriteLine("=================================");