Advertisement
Guest User

123456

a guest
Oct 15th, 2019
113
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.62 KB | None | 0 0
  1. int d = 0; //Tage 1 - 31
  2. int m = 0; //Monat 3 - 14
  3. int y = 0; // Jahr im Jahrhundert zweistellig
  4. int w = 0; //Wochentag: 0 für Sonntag 1 für Montag usw...
  5.  
  6. {int w = (d+(26*(m+1)/10)+(5*y/4)+(c/4)+(5*c)-1)%7; // gegeben siehe Aufgabe
  7. {if (w==0) {
  8. System.out.println ("Sonntag");
  9. }else if (w==1) {
  10. System.out.println ("Montag");
  11. }else if (w==2) {
  12. System.out.println ("Dienstag");
  13. }else if (w==3) {
  14. System.out.println ("Mittwoch");
  15. }else if (w==4) {
  16. System.out.println ("Donnerstag");
  17. }else if (w==5) {
  18. System.out.println ("Freitag");
  19. }else if (w==6)
  20. System.out.println ("Samstag");
  21. }
  22. }
  23. }
  24.  
  25. int
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement