Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int d = 0; //Tage 1 - 31
- int m = 0; //Monat 3 - 14
- int y = 0; // Jahr im Jahrhundert zweistellig
- int w = 0; //Wochentag: 0 für Sonntag 1 für Montag usw...
- {int w = (d+(26*(m+1)/10)+(5*y/4)+(c/4)+(5*c)-1)%7; // gegeben siehe Aufgabe
- {if (w==0) {
- System.out.println ("Sonntag");
- }else if (w==1) {
- System.out.println ("Montag");
- }else if (w==2) {
- System.out.println ("Dienstag");
- }else if (w==3) {
- System.out.println ("Mittwoch");
- }else if (w==4) {
- System.out.println ("Donnerstag");
- }else if (w==5) {
- System.out.println ("Freitag");
- }else if (w==6)
- System.out.println ("Samstag");
- }
- }
- }
- int
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement