-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathDatum
72 lines (67 loc) · 1.35 KB
/
Datum
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
import java.util.Scanner;
public class Kattistry {
public static void main(String[] args) {
Scanner scan=new Scanner (System.in);
int a=scan.nextInt();
int b=scan.nextInt();
int c ;
if (b==1){
c=0;
}
else if (b==2){
c=31;
}
else if (b==3){
c=59;
}
else if (b==4){
c=90;
}
else if (b==5){
c=120;
}
else if (b==6){
c=151;
}
else if (b==7){
c=181;
}
else if (b==8){
c=212;
}
else if (b==9){
c=243;
}
else if (b==10){
c=273;
}
else if (b==11){
c=304;
}
else{
c=334;
}
int d= (c+ a)%7;
if (d==1){
System.out.println("Thursday");
}
else if (d==2){
System.out.println("Friday");
}
else if (d==3){
System.out.println("Saturday");
}
else if (d==4){
System.out.println("Sunday");
}
else if (d==5){
System.out.println("Monday");
}
else if (d==6){
System.out.println("Tuesday");
}
else {
System.out.println("Wednesday");
}
}
}